Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OUTLOOK VBA

Status
Not open for further replies.

simoncpage2

Programmer
Feb 21, 2004
37
0
0
I want to write a script for Application_startup that will change the format of the email so that word is not used as the composer? How can this be done with VBA?

Thanks in advance
 
there is an EditorType, this might be a starting point, however it is a readonly property. this is a property of Inspector, i cant find a method for changing the EditorType.
I dont know for sure but you might this information is kept in the registry? it is worth a look. Change the value using the GUI and compare regsnaps, if not then jump on M$'s site and see what the KB says about how you can change it programmitically, sorry i cant be of anymore help

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


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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top