W
wpshop
I am trying to use the following code but I keep getting an error message
"the expression on click you entered as the event property setting produced
the following error: User defined type not defined". I am new to VBA code.
I found this online and was trying to use it for my purposes.
Dim Maildb As Object
Dim UserName As String
Dim MailDbName As String
Dim MailDoc As Object
Dim Body As Object
Dim Session As Object
Dim AttachME As Object
Dim EmbedObj As Object
Set Session = CreateObject("Notes.NotesSession")
Session.Initialize ("password")
UserName = Session.UserName
MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1,
UserName, " "))) & ".nsf"
Set Maildb = Session.GETDATABASE("", MailDbName)
If Maildb.ISOPEN = True Then
Else
Maildb.OPENMAIL
End If
Set MailDoc = Maildb.CREATEDOCUMENT
MailDoc.Form = "Memo"
MailDoc.sendto = Recipient
MailDoc.Subject = Subject
MailDoc.Body = BodyText
MailDoc.SAVEMESSAGEONSEND = SaveIt
If Attachment <> "" Then
Set AttachME = MailDoc.CREATERICHTEXTITEM("Test")
Set EmbedObj = AttachME.EMBEDOBJECT(1454, "", "H:\Training\Test.doc",
"test")
MailDoc.CREATERICHTEXTITEM ("Test")
End If
MailDoc.PostedDate = Now()
MailDoc.SEND 0, Recipient
Set Maildb = Nothing
Set MailDoc = Nothing
Set AttachME = Nothing
Set Session = Nothing
Set EmbedObj = Nothing
"the expression on click you entered as the event property setting produced
the following error: User defined type not defined". I am new to VBA code.
I found this online and was trying to use it for my purposes.
Dim Maildb As Object
Dim UserName As String
Dim MailDbName As String
Dim MailDoc As Object
Dim Body As Object
Dim Session As Object
Dim AttachME As Object
Dim EmbedObj As Object
Set Session = CreateObject("Notes.NotesSession")
Session.Initialize ("password")
UserName = Session.UserName
MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1,
UserName, " "))) & ".nsf"
Set Maildb = Session.GETDATABASE("", MailDbName)
If Maildb.ISOPEN = True Then
Else
Maildb.OPENMAIL
End If
Set MailDoc = Maildb.CREATEDOCUMENT
MailDoc.Form = "Memo"
MailDoc.sendto = Recipient
MailDoc.Subject = Subject
MailDoc.Body = BodyText
MailDoc.SAVEMESSAGEONSEND = SaveIt
If Attachment <> "" Then
Set AttachME = MailDoc.CREATERICHTEXTITEM("Test")
Set EmbedObj = AttachME.EMBEDOBJECT(1454, "", "H:\Training\Test.doc",
"test")
MailDoc.CREATERICHTEXTITEM ("Test")
End If
MailDoc.PostedDate = Now()
MailDoc.SEND 0, Recipient
Set Maildb = Nothing
Set MailDoc = Nothing
Set AttachME = Nothing
Set Session = Nothing
Set EmbedObj = Nothing