Charset

Hi All,

I have written following code to directly export the data to html.

Set c = s.DocumentContext

Dim HTMLcontent As String, HTMLhead As Variant ,HTMLbody As Variant

Dim rtiHTMLhead As NotesRichTextItem, rtiHTMLbody As NotesRichTextItem

Set rtiHTMLhead = c.GetFirstItem(“HTMLhead”)

Set rtiHTMLbody = c.GetFirstItem(“HTMLbody”)

HTMLhead= rtiHTMLhead.GetUnformattedText()

HTMLbody= rtiHTMLbody.GetUnformattedText()

'Sets the download to use Word

Print |Content-Type:text/html; charset=“UTF-8”|

'Triggers the save/open prompt instead of embedding the spreadsheet in the browser.

Print |Content-Disposition:Attachment; filename=“Report.html”|

Print ||

Print HTMLhead

Print ||

Print HTMLbody

Print ||

Where HTMLhead contains the required css and HTMLbody contains the required data to be shown.

The main purpose of this is to export the data to Word. But before that I wanted to test whether this would work perfectly for HTML before going for word.

For word I would be using -

Print |Content-Type:application/msword|

The problems I am facing are -

  1. Even after declaring the charset, single quotes and other text are not displayed clearly.

  2. If the HTMLbody field contains lot of data then only a part of it is shown. But when seen on the “documentcontext” it is having all the data.

As it is a rich text field I am putting the data first into a rich text field.

Can anyone help me what I am doing wrong here.

–Phani