Custormized forward button

Here is what I need to do:On a form, we need a button to foward document to predefined mail address.

  1. User edit document first, then foward document content to the mail address. Then close the document without saving it.

  2. The button should send out mail and document without prompt user a window to ask save or not.

I wrote this scipt. But the email I got is blank. No content of document included. Please help ! What is wrong with the script?

Sub Click(Source As Button)

Dim session As New NotesSession

Dim ws As New NotesUIWorkspace

Dim db As NotesDatabase

Dim uidoc As NotesUIDocument

Dim doc As NotesDocument

Dim forward As NotesUIDocument

Dim forwarddoc As NotesDocument

Dim SendTo As String



Set db = session.CurrentDatabase

Set uidoc = ws.CurrentDocument

Set doc = uidoc.Document

Call uidoc.Forward	



SendTo = "Jordan Guo"



Set forward = ws.CurrentDocument

Set forwarddoc = forward.Document

Call forwarddoc.Send(False, "Jordan Guo")

forwarddoc.SaveOptions="1"	

Call forward.Close



Msgbox "Document has been sent to "+SendTo,0+64+0,"Send successfully . Please close the form without saving it."



doc.SaveOptions="0"	

Call uidoc.Close

End Sub

Subject: Custormized forward button.

This works only in Notes 6.5, not 4.6. I am looking for the solution that works in both version. Thanks

Sub Click(Source As Button)

Dim session As New NotesSession

Dim ws As New NotesUIWorkspace

Dim db As NotesDatabase

Dim uidoc As NotesUIDocument

Dim doc As NotesDocument

Dim forward As NotesUIDocument

Dim forwarddoc As NotesDocument

Dim SendTo As String

Set db = session.CurrentDatabase

Set uidoc = ws.CurrentDocument

Set doc = uidoc.Document

Call uidoc.Forward

SendTo = “Jordan Guo”

Set forward = ws.CurrentDocument

Set forwarddoc = forward.Document

Call forward.FieldSetText(“EnterSendTo”, SendTo)

Call forward.FieldSetText(“EnterCopyTo”, session.CommonUserName)

Call forwarddoc.Send(False, “Jordan Guo”)

forwarddoc.SaveOptions=“0”

Call forward.Close

Msgbox "Document has been sent to "+SendTo,0+64+0,“Send successfully . Please close the form without saving it.”

doc.SaveOptions=“0”

Call uidoc.Close

End Sub

Subject: Custormized forward button. (Solution)

Perhaps there is somebody still searching for an answer for this question.Here is some code… hope it helps.

Dim session As New NotesSession

Dim ws As New NotesUIWorkspace

Dim db As NotesDatabase

Dim UIDoc As NotesUIDocument

Dim UIDocForward As NotesUIDocument

Dim DocForward As NotesDocument

Set db = session.CurrentDatabase

Set uidoc = ws.CurrentDocument

If uidoc.Document.ForwardDok(0) = “1” Then

Call uidoc.Forward

Set UIDocForward = ws.CurrentDocument

Call UIDocForward.FieldSetText(“EnterSendTo”,session.UserName)

Call UIDocForward.FieldSetText(“Subject”,“ACME”)

Call UIDocForward.GotoField(“Body”)

Call UIDocForward.GotoTop

Call UIDocForward.InsertText( “Doclink:” )

Call UIDocForward.InsertText( Chr(10) )

Set strServerName = New NotesName(db.Server)

Call UIDocForward.InsertText( “notes://” + strServerName.Common + “/” + db.Replicaid + “/0/” + UIDOC.Document.UniversalID )

Call UIDocForward.InsertText( Chr(10) )

UIDocForward.Document.SaveOptions = “0”

Call UIDocForward.Send

UIDocForward.Close

End If