Linas
09-13-2014, 05:15 AM
I have a form that currently users complete, save and then email to me as attachment via Lotus notes.
I would like them to be able to just click a 'Submit' button and have Lotus open and auto attach the form.
and pre-populate the email address it should be sent to (auto subject line would be nice too but less of a priority).
I am very new to this and trying to teach myself with little success.:banghead:
Any instructions created for a newbie would be would be greatly appreciated and paid forward when able.
: pray2:
Thanks
Okay - so trying to work from this - no idea if im on the right track but im getting stopped at the bolded line...help?
Private Sub CommandButton1_Click()
Dim Maildb As Object
Dim MailDoc As Object
Dim Body As Object
Dim Session As Object
Set Session = CreateObject("Lotus.NotesSession")
Call Session.Initialize
If Not Maildb.IsOpen = True Then
Call Maildb.Open
End If
Set MailDoc = Maildb.CREATEDOCUMENT
Call MailDoc.ReplaceItemValue("Form", "Memo")
Call MailDoc.ReplaceItemValue("Send to", "my email")
Call MailDoc.ReplaceItemValue("Subject", "Access Request")
Set Body = MailDoc.CREATERICHTEXTITEM("Body")
Call Body.APPENDTEXT("Thank you")
Call Body.ADDNEWLINE(2)
Call Body.EMBEDOBJECT(1454, "", "C:\filename", "Attachment")
Call MailDoc.ReplaceItemValue("PostedDate", Now())
Call MailDoc.SEND(False)
Set Maildb = Nothing
Set MailDoc = Nothing
Set Body = Nothing
Set Session = Nothing
End Sub
I would like them to be able to just click a 'Submit' button and have Lotus open and auto attach the form.
and pre-populate the email address it should be sent to (auto subject line would be nice too but less of a priority).
I am very new to this and trying to teach myself with little success.:banghead:
Any instructions created for a newbie would be would be greatly appreciated and paid forward when able.
: pray2:
Thanks
Okay - so trying to work from this - no idea if im on the right track but im getting stopped at the bolded line...help?
Private Sub CommandButton1_Click()
Dim Maildb As Object
Dim MailDoc As Object
Dim Body As Object
Dim Session As Object
Set Session = CreateObject("Lotus.NotesSession")
Call Session.Initialize
If Not Maildb.IsOpen = True Then
Call Maildb.Open
End If
Set MailDoc = Maildb.CREATEDOCUMENT
Call MailDoc.ReplaceItemValue("Form", "Memo")
Call MailDoc.ReplaceItemValue("Send to", "my email")
Call MailDoc.ReplaceItemValue("Subject", "Access Request")
Set Body = MailDoc.CREATERICHTEXTITEM("Body")
Call Body.APPENDTEXT("Thank you")
Call Body.ADDNEWLINE(2)
Call Body.EMBEDOBJECT(1454, "", "C:\filename", "Attachment")
Call MailDoc.ReplaceItemValue("PostedDate", Now())
Call MailDoc.SEND(False)
Set Maildb = Nothing
Set MailDoc = Nothing
Set Body = Nothing
Set Session = Nothing
End Sub