AppointmentItem.RTFBody property (Outlook)

Returns or sets a Byte array that represents the body of the Microsoft Outlook item in Rich Text Format. Read/write.

Syntax

expression. RTFBody

expression A variable that represents an 'AppointmentItem' object.

Remarks

Use the StrConv function in Microsoft Visual Basic for Applications (VBA), or the System.Text.Encoding.AsciiEncoding.GetString() method in C# or Visual Basic to convert an array of bytes to a string.

Example

The following code samples in Microsoft Visual Basic for Applications (VBA) and C# displays the Rich Text Format body of the appointment in the active inspector. An AppointmentItem must be the active inspector for this code to work.

Sub GetRTFBodyForMeeting() 
 
 Dim oAppt As Outlook.AppointmentItem 
 
 Dim strRTF As String 
 
 If Application.ActiveInspector.CurrentItem.Class = olAppointment Then 
 
 Set oAppt = Application.ActiveInspector.CurrentItem 
 
 strRTF = StrConv(oAppt.RTFBody, vbUnicode) 
 
 Debug.Print strRTF 
 
 End If 
 
End Sub
private void GetRTFBodyForAppt() 
 
{ 
 
 if (Application.ActiveInspector().CurrentItem is Outlook.AppointmentItem) 
 
 { 
 
 Outlook.AppointmentItem appt = 
 
 Application.ActiveInspector().CurrentItem as Outlook.AppointmentItem; 
 
 byte[] byteArray = appt.RTFBody as byte[]; 
 
 System.Text.Encoding encoding = new System.Text.ASCIIEncoding(); 
 
 string RTF = encoding.GetString(byteArray); 
 
 Debug.WriteLine(RTF); 
 
 } 
 
} 
 

See also

AppointmentItem Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.