M
Markus Jakobi
Hi all,
maybe someone can help me.
I stumbled over an (obviously well known) problem in Outlook 2000.
The plan is to write a macro that adds some text at the end of every mail
before sending the mail. When I modify the "Item.Body" of a plain-text mail,
the format changes to Rich text. Although the mail is sent out as plain
text, it is stored as RTF in the "Sent items"-folder.
To get the old format back, I tried the following VBA-macro:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim oCtl As Office.CommandBarControl
Dim oCB As Office.CommandBar
Set oCB = Application.ActiveInspector.CommandBars("Menu Bar")
Set oCtl = oCB.Controls("Format")
Set oCtl = oCtl.Controls("Plain Text")
oCtl.Execute
Set oCtl = Nothing
Set oCB = Nothing
End Sub
But when I click the Send-button, I get a message saying that "changing the
format to plain-text removes all formatting (blabla)".
Is there any way of getting around this message? I already thought of using
SendKeys "{TAB}{ENTER}", True
after the 'oCtl.Execute', but the execution of the macro seems to stop until
the user clicks one of the buttons.
Any ideas?
Thanks in advance!
Markus
maybe someone can help me.
I stumbled over an (obviously well known) problem in Outlook 2000.
The plan is to write a macro that adds some text at the end of every mail
before sending the mail. When I modify the "Item.Body" of a plain-text mail,
the format changes to Rich text. Although the mail is sent out as plain
text, it is stored as RTF in the "Sent items"-folder.
To get the old format back, I tried the following VBA-macro:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim oCtl As Office.CommandBarControl
Dim oCB As Office.CommandBar
Set oCB = Application.ActiveInspector.CommandBars("Menu Bar")
Set oCtl = oCB.Controls("Format")
Set oCtl = oCtl.Controls("Plain Text")
oCtl.Execute
Set oCtl = Nothing
Set oCB = Nothing
End Sub
But when I click the Send-button, I get a message saying that "changing the
format to plain-text removes all formatting (blabla)".
Is there any way of getting around this message? I already thought of using
SendKeys "{TAB}{ENTER}", True
after the 'oCtl.Execute', but the execution of the macro seems to stop until
the user clicks one of the buttons.
Any ideas?
Thanks in advance!
Markus