Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Nov 2003
    Location
    Vancouver, Washington, USA
    Posts
    103
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macro: Message Format Mod's (Outlook (2000))

    Hello y'all,

    I have a client who is seeking to automate the following in a Macro in Outlook (2K) (We will be transitioning to Outlook 2003, so the macros must be able to run in 2003)

    1. From a message choose Format->Plain Text
    2. Say Yes to the warning.
    3. Again choose Format->Rich Text and the process is done.

    Also, would like to get a "HTML_to_RTF" macro and a "RTF_to_HTML" macro if possible.

    Is this possible?

    Thanks much,
    Rich

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro: Message Format Mod's (Outlook (2000))

    You can use the following as starting point. If an error occurs (for example because no mail item is open), the macros just beep. You can uncomment the MsgBox line to display an errror message instead.

    Sub Convert2RTF()
    On Error GoTo ErrHandler
    ActiveInspector.CurrentItem.BodyFormat = olFormatRichText
    Exit Sub
    ErrHandler:
    ' MsgBox Err.Description, vbExclamation
    Beep
    End Sub

    Sub Convert2HTML()
    On Error GoTo ErrHandler
    ActiveInspector.CurrentItem.BodyFormat = olFormatHTML
    Exit Sub
    ErrHandler:
    ' MsgBox Err.Description, vbExclamation
    Beep
    End Sub

    Sub Convert2Plain()
    On Error GoTo ErrHandler
    ActiveInspector.CurrentItem.BodyFormat = olFormatPlain
    Exit Sub
    ErrHandler:
    ' MsgBox Err.Description, vbExclamation
    Beep
    End Sub

  3. #3
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Macro: Message Format Mod's (Outlook (2000))

    To permanently convert the format, I expect you would need:

    ActiveInspector.CurrentItem.Save

    After each

    ActiveInspector.CurrentItem.BodyFormat = ...

    line. Also, conversion of some HTML messages to text, especially those with tables, may result in a jumbled mess (voice of experience on this).
    -John ... I float in liquid gardens
    UTC -7ąDS

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro: Message Format Mod's (Outlook (2000))

    I thought about .Save, but left it out intentionally to give the user a chance to close the e-mail without saving if the result is not satisfactory - as you indicate it may be. But a good point.

  5. #5
    2 Star Lounger
    Join Date
    Nov 2003
    Location
    Vancouver, Washington, USA
    Posts
    103
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Macro: Message Format Mod's (Outlook (2000))

    Dear Hans,

    As usual, you've come to the rescue! Thanks so much.

    What I thought would be a simple task is confusing to me now.

    I thought the macros would be run when an email message is open, rather than in a folder list view. If so, where do I save the macro VBA?

    Thanks so much,
    Rich

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro: Message Format Mod's (Outlook (2000))

    As usual, macros are stored in a module in the Visual Basic Editor.
    - In Outlook, press Alt+F11 to activate the Visual Basic Editor.
    - Select Insert | Module to create a new module.
    - Type or copy the macros into the module.

    You can assign macros to a toolbar button or menu item:
    - Open an e-mail.
    - Select Tools | Customize...
    - Activate the Commands tab.
    - Select the Macros category.
    - Drag the macros to the toolbar of the e-mail window.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •