Vba 从Access 2003生成电子邮件时,如何在Lotus notes中加粗字体?

Vba 从Access 2003生成电子邮件时,如何在Lotus notes中加粗字体?,vba,lotus-notes,ms-access-2003,Vba,Lotus Notes,Ms Access 2003,我正在运行Access 2003,并创建了一个模块,该模块从Lotus Notes中的数据库向收件人发送电子邮件。它工作得很好,但现在我被要求在电子邮件中“加粗”特定文本,以便更容易在他们的黑莓手机上阅读。有人能帮我格式化文本吗?我不知道该怎么做。。。。以下是我正在使用的代码: Public Sub SendQtrNotesMail(Subject As String, Recipient As String, WL As String, SQA As String, _ DC As Str

我正在运行Access 2003,并创建了一个模块,该模块从Lotus Notes中的数据库向收件人发送电子邮件。它工作得很好,但现在我被要求在电子邮件中“加粗”特定文本,以便更容易在他们的黑莓手机上阅读。有人能帮我格式化文本吗?我不知道该怎么做。。。。以下是我正在使用的代码:

Public Sub SendQtrNotesMail(Subject As String, Recipient As String, WL As String, SQA   As String, _
DC As String, ADR As String, TDR As String, SafetyNote As String, QualityNote As String, _
ProdNote As String, SaveIt As Boolean)
'Set up the objects required for Automation into lotus notes
Dim Maildb As Object 'The mail database
Dim UserName As String 'The current users notes name
Dim MailDbName As String 'The current users notes mail database name
Dim MailDoc As Object 'The mail document itself
Dim Session As Object 'The notes session
Dim EmbedObj As Object 'The embedded object (Attachment)
'Start a session to notes
Set Session = CreateObject("Notes.NotesSession")
'Get the sessions username and then calculate the mail file name
'You may or may not need this as for MailDBname with some systems you
'can pass an empty string or using above password you can use other mailboxes.
UserName = Session.UserName
MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1,   UserName, " "))) & ".nsf"
'Open the mail database in notes
Set Maildb = Session.getdatabase("", MailDbName)
 If Maildb.ISOPEN = True Then
'Already open for mail
 Else
     Maildb.openmail
 End If
'Set up the new mail document
Set MailDoc = Maildb.createdocument
MailDoc.Form = "Memo"
MailDoc.sendto = Recipient
MailDoc.Subject = Subject
MailDoc.Body = WL & vbCrLf & SQA & vbCrLf & DC & vbCrLf & ADR & vbCrLf & TDR & vbCrLf   &vbCrLf & _
SafetyNote & vbCrLf & QualityNote & vbCrLf & ProdNote
MailDoc.SaveMessageOnSend = SaveIt
'Send the document
MailDoc.PostedDate = Now() 'Gets the mail to appear in the sent items folder
MailDoc.Send 0, Recipient
'Clean Up
Set Maildb = Nothing
Set MailDoc = Nothing
Set Session = Nothing
Set EmbedObj = Nothing
End Sub
以及:


我上面的加粗的内容是我的管理层希望在电子邮件中看到的加粗内容。有人能告诉我如何实现这一点的正确方向吗?

请尝试使用NotesRichTextStyle类,下面是designer帮助中的示例:

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")
  Call richText.AppendText("The meeting is at ")
  richStyle.Bold = True
  Call richText.AppendStyle(richStyle)
  Call richText.AppendText("3:00")
  richStyle.Bold = False
  Call richText.AppendStyle(richStyle)
  Call richText.AppendText(" not 2:00")
  Call doc.Save(True, False)
End Sub
这里是帮助的链接-->

您是否看到:
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")
  Call richText.AppendText("The meeting is at ")
  richStyle.Bold = True
  Call richText.AppendStyle(richStyle)
  Call richText.AppendText("3:00")
  richStyle.Bold = False
  Call richText.AppendStyle(richStyle)
  Call richText.AppendText(" not 2:00")
  Call doc.Save(True, False)
End Sub