WordEditor Property

Microsoft Outlook Visual Basic

WordEditor Property

       

Returns the Microsoft Word Document Object Model of the message being displayed. This object model may be temporary and should not be stored for later use. The WordEditor property is only valid if IsWordMail returns True and the EditorType is olEditorWord. Read-only.

objInspector.WordEditor

objInspector    Required. An expression that returns an Inspector object.

Example

The following VBScript example demonstrates the use of Word's object model. It adds a filled rectangle to the message area of the item.

Sub CommandButton1_Click()
    Set myInspector = Item.GetInspector
    Set WordDoc = myInspector.WordEditor
    Set Fill = WordDoc.Shapes.AddShape(1, 90, 90, 90, 50).Fill   'msoShapeRectangle=1
    Fill.ForeColor.RGB = RGB(128, 0, 0)
    Fill.BackColor.RGB = RGB(170, 170, 170)
    Fill.TwoColorGradient 4, 1   'msoGradientDiagonalDown=4
End Sub