Agent to send fax sends cover page only!

Hi all,

Picking up a doc in a view and creating a fax doc from it and sending the fax doc to a fax number/fax database.

When running through the agent below in debug mode, the faxDoc document has all the fields copied over using the copyAllItems method but when the fax is received, it’s only got a cover page.

I know I need to create a “body” - how can I copy the contents of the current Doc into a fxDoc.body field?

Sub Initialize

Dim session As New NotesSession

Dim currentDb As NotesDatabase

Dim view As NotesView

Dim selectedDocs As NotesDocumentCollection

Dim currentDoc As NotesDocument, faxDoc As NotesDocument

Dim pruFaxTo As String

Dim pruStatus As NotesItem, pruBody As NotesRichTextItem



Set currentDb = session.CurrentDatabase

Set selectedDocs = currentDb.UnprocessedDocuments

Set currentDoc = selectedDocs.GetFirstDocument 

'

'Get the details of who we are faxing to 	pruFaxTo = "FaxRecipient@0123456789@Faxservice"



While Not currentDoc Is Nothing

	'

	'Set up the fax doc 

	Set faxDoc = currentDb.CreateDocument

	faxDoc.Principal="zzz Responses"

	faxDoc.From="zzz Responses"

	faxDoc.Subject="New Business Fax - [" & currentDoc.uniqueAppNum(0) & "]"

	Call currentDoc.CopyAllItems(faxDoc, True)

	'

	'Address the fax doc

	faxDoc.SendTo=pruFaxTo

	faxDoc.CopyTo=""

	faxDoc.BlindCopyTo=""

	Call faxDoc.Send(False)

	'

	'Update the currentDoc

	Set pruStatus = currentDoc.GetFirstItem("StatusHistory")

	Call pruStatus.AppendToTextList(Now + " :  Document faxed to " + pruFaxTo)

	Call currentDoc.Save(True, False, False)

	Count=Count+1

	

	Set  currentDoc= selectedDocs.getnextdocument(currentDoc)

Wend     



Messagebox "Faxed " & Cstr(Count) & " documents!"

End Sub

Thanks

Jon

Subject: Agent to send fax sends cover page only!

Are you looking for something like this function?

flag = notesDocument.RenderToRTItem( notesRichTextItem )

Where notesRichTextitem = body item on your new document.

Subject: RE: Agent to send fax sends cover page only!

IP - one word…Genius.

Cheers fella