Exportieren von rich-text in outlook und halten Sie die Formatierung

Ich habe einen button in Access, öffnet sich Outlook, erstellen eines Termins.

Private Sub addAppointEstimate_Click()
    Dim objOutlook As Object
    Dim objOutLookApp As Object
    Dim strSubject As String
    Dim strBody As String

    strSubject = Forms!frmMain.LastName 'more stuff to add
    strBody = DLookup("EstimateText", "tblEstimateItems", "EstimateID = 78") '& Forms!frmMain!frmSubTransaction!frmSubEstimate.Form.EstimateID)

    Set objOutlook = CreateObject("Outlook.Application")
    Set objOutLookApp = objOutlook.CreateItem(1)
    With objOutLookApp
        .subject = strSubject
        .RTFBody = StrConv(strBody, vbFromUnicode)
        .Display
    End With

End Sub

Das problem ist, dass ich einfügen möchte, Rich-text in den Körper, aber es nicht formatieren, da es zeigt alle HTML-tags statt e.g:

<div><strong>example </strong><font color=red>text</font></div>

Gibt es eine Möglichkeit, die ich senden kann oder konvertieren Sie die rich-text in Outlook in einem format, das es zu erkennen? (Vielleicht über die Zwischenablage)

Es scheint, viele Menschen haben eine Lösung für Excel, aber ich bin kämpfen, um zu arbeiten in Access:

Ist strBody wirklich eine RTF-formatierten string oder HTML? Im letzteren Fall, setzen Sie einfach die HTMLBody-Eigenschaft.

InformationsquelleAutor Magnus | 2014-06-16

Schreibe einen Kommentar