I have created a Microsoft Infopath form and I am trying to create a button to submit via lotus notes. I have cut and pasted some vb code from http://blog.advisor.com/blog/garydev.nsf/d6plinks/GDEF-64D3JL
but I’m getting an error. If anyone could help point me in the right direction i would really appreciate it. Thanks in Advance!
Jeff
The following Error Occurred
Expected ‘;’
File:Scrpit.js
Line:41
{ ;Sub btnLotus_OnClick(eventObj)
HERE IS MY CODE THAT I HAVE ENTERED
CTRL31_5::OnClick(eventObj)
{Sub btnLotus_OnClick(eventObj)
'Dim domSession As New NotesSession
on error resume next
Dim strFormName
strFormName = "Form1.XML"
Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
If Len(FSO.GetFile("C:\" & strFormName)) > 0 Then
FSO.DeleteFile "c:\" & strFormName
End If
on error goto 0
Dim domSession
Set domSession = CreateObject(“Lotus.NotesSession”)
Dim domNotesDatabaseMailFile
Dim domNotesDocumentMemo
Dim domNotesRichTextItemBody
“jeff56Tidwell”
Dim dbdir
Set dbdir = domSession.GetDbDirectory(“”)
Set domNotesDatabaseMailFile = dbdir.OpenMailDatabase
’ Generate an error if previous attempts were unsuccessful.
If domNotesDatabaseMailFile Is Nothing Then
MsgBox "Mail file not open"
Exit Sub
End If
Dim SendToArray
'SendToArray = “jjtidwell@gmail.com”
’ Create a new memo document.
Set domNotesDocumentMemo = domNotesDatabaseMailFile.CreateDocument
Call domNotesDocumentMemo.AppendItemValue(“Form”, “Memo”)
Call domNotesDocumentMemo.AppendItemValue(“From”, domSession.CommonUserName)
Call domNotesDocumentMemo.AppendItemValue(“SendTo”, jjtidwell@gmail.com)
Call domNotesDocumentMemo.AppendItemValue(“Subject”, “From infopath”)
Set domNotesRichTextItemBody = domNotesDocumentMemo.CreateRichTextItem(“Body”)
domNotesRichTextItemBody.AppendText “This is a test”
Exit Sub
End Sub}