Avatar of Dian S
Dian S

asked on 

Change fonts in access vba to send mail in lotus notes

Hi ,

I know only basic vba.
I would like to send mail in lotus notes via microsoft access vba.
I found this code in the IBM website as example codes to change the fonts.

I copy paste to my script but it stopt on  "Dim session As New NotesSession" and error message is user-defined type is not defined.
Could you please help?
Many thanks

Sub Initialize
  Dim session As New NotesSession
  Dim db As NotesDatabase
  Set db = session.CurrentDatabase
  Dim doc As New NotesDocument(db)
  Call doc.AppendItemValue("From", session.UserName)
  Call doc.AppendItemValue("Subject",  _
  "Meeting time changed")
  Dim richStyle As NotesRichTextStyle
  Set richStyle = session.CreateRichTextStyle
  Dim richText As New NotesRichTextItem(doc, "Body")
  richStyle.NotesFont = FONT_HELV
  Call richText.AppendStyle(richStyle)
  Call richText.AppendText("The meeting is at ")
  richStyle.NotesFont = FONT_COURIER
  Call richText.AppendStyle(richStyle)
  Call richText.AppendText("3:00")
  richStyle.NotesFont = FONT_HELV
  Call richText.AppendStyle(richStyle)
  Call richText.AppendText(" not 2:00")
  Call doc.Save(True, False)
End Sub
Microsoft AccessFonts TypographyVBA

Avatar of undefined
Last Comment
Dian S

8/22/2022 - Mon