I have a mail in database that has a custom forward action. However when there is an attachment in the mail message this seems to be lost as soon as the new message is put into edit mode.
This is the script that is being used.
Dim session As New notessession
Dim db As notesdatabase
Dim collection As notesdocumentcollection
Dim ws As New notesuiworkspace
Dim uidoc As notesuidocument
Dim doc As NotesDocument
Dim nameslist As Variant
Dim newname As Integer
Dim filename As Variant
Dim view As notesview
Dim viewdoc As notesdocument
Set db=session.currentdatabase
Set view = db.getview("(UNID)")
'On Error Resume Next
Set uidoc = ws.currentdocument
If uidoc Is Nothing Then
Set collection = db.unprocesseddocuments
Set doc = collection.getfirstdocument
Else
Set doc = uidoc.document
Messagebox "uidoc found"
End If
Dim newdoc As notesdocument
Dim rtItem As NotesRichTextItem
Dim object As NotesEmbeddedObject
Set newdoc = New NotesDocument( db )
newdoc.Form="Reply with History"
newdoc.From="CdxTechnicalSupport"
newdoc.Principal = "CdxTechnicalSupport"
newdoc.SendTo=""
newdoc.CopyTo=""
newdoc.Subject=doc.Subject(0)
Set rtitem = doc.getfirstitem("body")
Set newRTItem = New NotesRichTextItem ( newdoc, "Body" )
Call newrtitem.AppendRTItem( rtitem )
Call newrtitem.AddNewLine(1)
'Set object = newrtitem.EmbedObject _
'( EMBED_ATTACHMENT, "", "c:\Temp\"+filename(0))
Call newdoc.Save( True, True )
Call view.refresh
Sleep 10
Messagebox newdoc.UniversalID
unid$ = newdoc.UniversalID
Messagebox "UNID$ " + unid$
Set viewdoc = view.getdocumentbykey(unid$,True)
If viewdoc.hasitem("$file") Then
Messagebox "has item"
End If
'Dim newws As New notesuiworkspace
Dim newuidoc As notesuidocument
Set newuidoc = ws.editdocument(True,viewdoc)
Exit Sub
Thanks in advance

