![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
I need to create a macro in Outlook 2002 to change the mail format from HTML
to rich text and another to change it back to HTML. Can anyone help? -- Maureen |
#2
|
|||
|
|||
![]()
Hi Maureen. If you're dealing with these settings at a program level, see my
post he Outlook's Message Format Settings In The Registry: http://blogs.officezealot.com/legaul...8/03/1324.aspx For a specific message, you will have to automate clicking the choices under the Format menu by using CommandBar and CommandBarButton objects from the Office Object Model. However, you have to switch to Plain Text in between. So HTML - Plain Text - Rich Text - Plain Text - HTML. Why do you need to do this? -- Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Maureen" wrote: I need to create a macro in Outlook 2002 to change the mail format from HTML to rich text and another to change it back to HTML. Can anyone help? -- Maureen |
#3
|
|||
|
|||
![]()
I was asked to create a series of documents in Word that includes data pasted
from the clipboard when the Word macro is run. To satisfy all the requirements, I changed the Outlook mail format to HTML using MS Word to Edit Email Msgs. We receive some email that takes FOREVER to open in Word when forwarded (daily procedure), so we need to be able to easily uncheck the MS Word to Edit Email Msgs box before forwarding these messages and easily re-check that box. They are used to having buttons on the toolbar to perform macros and other tasks, so that's why I need a macro in Outlook. I know how to create a macro in Word and can fake my way through some VBA, but I don't know where to start to have an Outlook macro change the mailformat for me. -- Maureen "Eric Legault [MVP - Outlook]" wrote: Hi Maureen. If you're dealing with these settings at a program level, see my post he Outlook's Message Format Settings In The Registry: http://blogs.officezealot.com/legaul...8/03/1324.aspx For a specific message, you will have to automate clicking the choices under the Format menu by using CommandBar and CommandBarButton objects from the Office Object Model. However, you have to switch to Plain Text in between. So HTML - Plain Text - Rich Text - Plain Text - HTML. Why do you need to do this? -- Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Maureen" wrote: I need to create a macro in Outlook 2002 to change the mail format from HTML to rich text and another to change it back to HTML. Can anyone help? -- Maureen |
#4
|
|||
|
|||
![]()
If you're new to Outlook VBA, this is an excellent resource to help get you
started: Visual Basic and VBA Coding in Microsoft Outlook: http://www.outlookcode.com/d/vb.htm However, what you want to do doesn't really involve using VBA with the Outlook Object Model, but direct modifications to the registry as I describe in my blog post referred to in my previous message. To modify the registry, Google for "VB Registry Class" for plenty of free source code that can help you set and retrieve registry values. Once that code is in place inside a VBA module, wire a macro up to a custom button much like you do in Word. One caveat: changes to values in registry keys that Outlook uses may not be read until Outlook is restarted. I currently do not know if Outlook's message format values in the registry behave in the same way. -- Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Maureen" wrote: I was asked to create a series of documents in Word that includes data pasted from the clipboard when the Word macro is run. To satisfy all the requirements, I changed the Outlook mail format to HTML using MS Word to Edit Email Msgs. We receive some email that takes FOREVER to open in Word when forwarded (daily procedure), so we need to be able to easily uncheck the MS Word to Edit Email Msgs box before forwarding these messages and easily re-check that box. They are used to having buttons on the toolbar to perform macros and other tasks, so that's why I need a macro in Outlook. I know how to create a macro in Word and can fake my way through some VBA, but I don't know where to start to have an Outlook macro change the mailformat for me. -- Maureen "Eric Legault [MVP - Outlook]" wrote: Hi Maureen. If you're dealing with these settings at a program level, see my post he Outlook's Message Format Settings In The Registry: http://blogs.officezealot.com/legaul...8/03/1324.aspx For a specific message, you will have to automate clicking the choices under the Format menu by using CommandBar and CommandBarButton objects from the Office Object Model. However, you have to switch to Plain Text in between. So HTML - Plain Text - Rich Text - Plain Text - HTML. Why do you need to do this? -- Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Maureen" wrote: I need to create a macro in Outlook 2002 to change the mail format from HTML to rich text and another to change it back to HTML. Can anyone help? -- Maureen |
#5
|
|||
|
|||
![]()
Thank you for your help, but I'm trying to NOT make any changes in the
registry if possible. Your suggestions have definitely educated me and helped me though. -- Maureen "Eric Legault [MVP - Outlook]" wrote: If you're new to Outlook VBA, this is an excellent resource to help get you started: Visual Basic and VBA Coding in Microsoft Outlook: http://www.outlookcode.com/d/vb.htm However, what you want to do doesn't really involve using VBA with the Outlook Object Model, but direct modifications to the registry as I describe in my blog post referred to in my previous message. To modify the registry, Google for "VB Registry Class" for plenty of free source code that can help you set and retrieve registry values. Once that code is in place inside a VBA module, wire a macro up to a custom button much like you do in Word. One caveat: changes to values in registry keys that Outlook uses may not be read until Outlook is restarted. I currently do not know if Outlook's message format values in the registry behave in the same way. -- Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Maureen" wrote: I was asked to create a series of documents in Word that includes data pasted from the clipboard when the Word macro is run. To satisfy all the requirements, I changed the Outlook mail format to HTML using MS Word to Edit Email Msgs. We receive some email that takes FOREVER to open in Word when forwarded (daily procedure), so we need to be able to easily uncheck the MS Word to Edit Email Msgs box before forwarding these messages and easily re-check that box. They are used to having buttons on the toolbar to perform macros and other tasks, so that's why I need a macro in Outlook. I know how to create a macro in Word and can fake my way through some VBA, but I don't know where to start to have an Outlook macro change the mailformat for me. -- Maureen "Eric Legault [MVP - Outlook]" wrote: Hi Maureen. If you're dealing with these settings at a program level, see my post he Outlook's Message Format Settings In The Registry: http://blogs.officezealot.com/legaul...8/03/1324.aspx For a specific message, you will have to automate clicking the choices under the Format menu by using CommandBar and CommandBarButton objects from the Office Object Model. However, you have to switch to Plain Text in between. So HTML - Plain Text - Rich Text - Plain Text - HTML. Why do you need to do this? -- Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Maureen" wrote: I need to create a macro in Outlook 2002 to change the mail format from HTML to rich text and another to change it back to HTML. Can anyone help? -- Maureen |
#6
|
|||
|
|||
![]()
Am Tue, 14 Mar 2006 10:56:29 -0800 schrieb Eric Legault [MVP - Outlook]:
While with the CommandBar trick you´ll lose all the formattings, in OL 2002 (and up) you could simply switch the Bodyformat property. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.vbOffice.net -- Hi Maureen. If you're dealing with these settings at a program level, see my post he Outlook's Message Format Settings In The Registry: http://blogs.officezealot.com/legaul...8/03/1324.aspx For a specific message, you will have to automate clicking the choices under the Format menu by using CommandBar and CommandBarButton objects from the Office Object Model. However, you have to switch to Plain Text in between. So HTML - Plain Text - Rich Text - Plain Text - HTML. Why do you need to do this? |
#7
|
|||
|
|||
![]()
Do you mean that when I open a message, there's a way to change the body
format before clicking on forward? I looked through all the toolbars and didn't find that choice. -- Maureen "Michael Bauer" wrote: Am Tue, 14 Mar 2006 10:56:29 -0800 schrieb Eric Legault [MVP - Outlook]: While with the CommandBar trick you´ll lose all the formattings, in OL 2002 (and up) you could simply switch the Bodyformat property. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.vbOffice.net -- Hi Maureen. If you're dealing with these settings at a program level, see my post he Outlook's Message Format Settings In The Registry: http://blogs.officezealot.com/legaul...8/03/1324.aspx For a specific message, you will have to automate clicking the choices under the Format menu by using CommandBar and CommandBarButton objects from the Office Object Model. However, you have to switch to Plain Text in between. So HTML - Plain Text - Rich Text - Plain Text - HTML. Why do you need to do this? |
#8
|
|||
|
|||
![]()
Certainly; this option is already there and if you didn't know about it, you
don't need any code. With an open message, select the format you want from the Format menu. Note that Rich Text will not be listed if the current format is HTML, and vice versa. You need to switch to Plain Text when converting between Rich Text and HTML back and forth. -- Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Maureen" wrote: Do you mean that when I open a message, there's a way to change the body format before clicking on forward? I looked through all the toolbars and didn't find that choice. -- Maureen "Michael Bauer" wrote: Am Tue, 14 Mar 2006 10:56:29 -0800 schrieb Eric Legault [MVP - Outlook]: While with the CommandBar trick you´ll lose all the formattings, in OL 2002 (and up) you could simply switch the Bodyformat property. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.vbOffice.net -- Hi Maureen. If you're dealing with these settings at a program level, see my post he Outlook's Message Format Settings In The Registry: http://blogs.officezealot.com/legaul...8/03/1324.aspx For a specific message, you will have to automate clicking the choices under the Format menu by using CommandBar and CommandBarButton objects from the Office Object Model. However, you have to switch to Plain Text in between. So HTML - Plain Text - Rich Text - Plain Text - HTML. Why do you need to do this? |
#9
|
|||
|
|||
![]()
Since the majority of the time we need HTML format and Use Word as Email
Editor, that's the default. When I open a message that I want to forward, I have no choices available when I click on Format. -- Maureen "Eric Legault [MVP - Outlook]" wrote: Certainly; this option is already there and if you didn't know about it, you don't need any code. With an open message, select the format you want from the Format menu. Note that Rich Text will not be listed if the current format is HTML, and vice versa. You need to switch to Plain Text when converting between Rich Text and HTML back and forth. -- Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Maureen" wrote: Do you mean that when I open a message, there's a way to change the body format before clicking on forward? I looked through all the toolbars and didn't find that choice. -- Maureen "Michael Bauer" wrote: Am Tue, 14 Mar 2006 10:56:29 -0800 schrieb Eric Legault [MVP - Outlook]: While with the CommandBar trick you´ll lose all the formattings, in OL 2002 (and up) you could simply switch the Bodyformat property. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.vbOffice.net -- Hi Maureen. If you're dealing with these settings at a program level, see my post he Outlook's Message Format Settings In The Registry: http://blogs.officezealot.com/legaul...8/03/1324.aspx For a specific message, you will have to automate clicking the choices under the Format menu by using CommandBar and CommandBarButton objects from the Office Object Model. However, you have to switch to Plain Text in between. So HTML - Plain Text - Rich Text - Plain Text - HTML. Why do you need to do this? |
#10
|
|||
|
|||
![]()
Am Wed, 15 Mar 2006 06:45:28 -0800 schrieb Maureen:
No, you first need to click on Forward. This little sample creates the forward mail and switches the format: Sub test111() Dim mail As MailItem Set mail = Application.ActiveInspector.CurrentItem.Forward If mail.BodyFormat = olFormatHTML Then mail.BodyFormat = olFormatRichText Else mail.BodyFormat = olFormatHTML End If End Sub You could add your own button to the toolbar and run that code by clicking the button. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.vbOffice.net -- Do you mean that when I open a message, there's a way to change the body format before clicking on forward? I looked through all the toolbars and didn't find that choice. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro within a Mail Message | Tia | Outlook and VBA | 1 | February 7th 06 02:47 PM |
How to determine the format for each e-mail in Outlook 2000? | Uncle Bill | Outlook - Using Contacts | 0 | February 1st 06 09:46 PM |
Troubles adding a macro to Mail Message - help please | [email protected] | Outlook and VBA | 4 | January 26th 06 11:01 PM |
Shortcut to change message format | Postman | Outlook - General Queries | 3 | January 17th 06 08:56 PM |
Choosing OptionsMail Format Crashes Outlook 2003 | Baer Bradford | Outlook - Installation | 2 | January 13th 06 05:36 AM |