FormDescription.ScriptText-Eigenschaft (Outlook)

Gibt eine Zeichenfolge, den alle VBScript-Code im Skript-Editor des Formulars enthält. Schreibgeschützt.

Syntax

Ausdruck. ScriptText

Ausdruck Eine Variable, die ein FormDescription-Objekt darstellt.

Beispiel

This Microsoft Visual Basic Scripting Edition (VBScript) example uses the Open event to access the HTMLBody property of a MailItem. This sets the EditorType property of the MailItem 's Inspector to olEditorHTML. When the MailItem 's Body property is set, the EditorType property is changed to the default. Wenn der Standard-E-Mail-Editor beispielsweise auf RTF festgelegt ist, wird EditorType auf olEditorRTF festgelegt. If this code is placed in the Script Editor of a form in design mode, the message boxes during run time will reflect the change in the EditorType as the body of the form changes. The final message box uses the Script Text property to display all the VBScript code in the Script Editor.

Function Item_Open() 
 
 'Set the HTMLBody of the item. 
 
 Item.HTMLBody = "<HTML><H2>My HTML page.</H2><BODY>My body.</BODY></HTML>" 
 
 'Item displays HTML message. 
 
 Item.Display 
 
 'MsgBox shows EditorType is 2. 
 
 MsgBox "HTMLBody EditorType is " & Item.GetInspector.EditorType 
 
 'Access the Body and show 
 
 'the text of the Body. 
 
 MsgBox "This is the Body: " & Item.Body 
 
 'After accessing, EditorType 
 
 'is still 2. 
 
 MsgBox "After accessing, the EditorType is " & Item.GetInspector.EditorType 
 
 'Set the item's Body property. 
 
 Item.Body = "Back to default body." 
 
 'After setting, EditorType is 
 
 'now back to the default. 
 
 MsgBox "After setting, the EditorType is " & Item.GetInspector.EditorType 
 
 'Access the items's 
 
 'FormDescription object. 
 
 Set myForm = Item.FormDescription 
 
 'Display all the code 
 
 'in the Script Editor. 
 
 MsgBox myForm.ScriptText 
 
End Function

Siehe auch

FormDescription-Objekt

Support und Feedback

Haben Sie Fragen oder Feedback zu Office VBA oder zu dieser Dokumentation? Unter Office VBA-Support und Feedback finden Sie Hilfestellung zu den Möglichkeiten, wie Sie Support erhalten und Feedback abgeben können.