0

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

と:

Sub SendEmail()
Dim stTotw As String
Dim HoldWL As String
Dim HoldSQA As String
Dim HoldDC As String
Dim HoldADR As String
Dim HoldTDR As String
Dim HoldSafetyNotes As String
Dim HoldQualityNotes As String
Dim HoldProdNotes As String
HoldWL = "WL:  " & Forms!frmAMQtr!WL.Value
HoldSQA = "SQA:  " & Forms!frmAMQtr!SQA.Value
HoldDC = "DC:  " & Forms!frmAMQtr!DC.Value
HoldADR = "A DR:  " & Forms!frmAMQtr!ADR.Value
HoldTDR = "Total DR:  " & Forms!frmAMQtr!TDR.Value
HoldSafetyNotes = "**Safety Issues & Details:"** & Forms!frmAMQtr![subfrmAMQtrNotes].Form!AMSafetyNote.Value
HoldQualityNotes = "**Quality Issues & Details**:  " & Forms!frmAMQtr![subfrmAMQtrNotes].Form!AMQualityNote.Value
HoldProdNotes = "**Productivity Issues & Details**:  " & Forms!frmAMQtr![subfrmAMQtrNotes].Form!AMProdNote.Value
stTotw = "myboss@abc.com"
Call SendQtrNotesMail("Test Email", stTotw, HoldWL, HoldSQA, HoldDC, HoldADR, HoldTDR, _
HoldSafetyNotes, HoldQualityNotes, HoldProdNotes, True)

End Sub

上で太字になっているのは、上司が電子メールで太字で表示したい内容です。これを達成する方法について、誰かが私を正しい方向に向けることができますか?

4

1 に答える 1

2

こんにちは、NotesRichTextStyle クラスの使用を検討してみてください。以下はデザイナー ヘルプの例です。

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

ヘルプへのリンクは次のとおりです --> http://www-12.lotus.com/ldd/doc/domino_notes/7.0/help7_designer.nsf/2e73cbb2141acefa85256b8700688cea/7aebd0afd95906568525704a0040fc50?OpenDocument

于 2010-03-09T16:36:34.027 に答える