Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Mar 2001
    Posts
    309
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Macro - VBA (Outlook 2002)

    I don't know VBA. Here is the macro I would like to create in Outlook.
    First I would open up a message I received.
    Now the macro - I would like to select all the text in the body of the message
    Now I want to select copy
    Now open up Word 2002
    Now edit / paste to Work document from Outlook.
    With document data in word still highlighted I need to go to File / Page Setup - change all the margins to .3 and orientation to landscape
    Close page setup and change font size to .8 and end macro.
    end macro.

    Can the macro be assigned to a shortcut key or Button on the toolbar in Outlook like you can in Word?

    Thanks in advance......

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Macro - VBA (Outlook 2002)

    Let me start with the last question first: you can assign a macro to a button and, if you put an "accelerator" key on the button (e.g., the S in Send), you can use an Alt-key combination to run it.

    Now, about this document you want to create. You can save yourself a lot of steps by creating a Word template that has the page layout and font size you want. Then, your macro would be simpler:

    [list=1]<LI>Create a new Word document using your template

    <UL>Dim wrdApp As Word.Application, wrdDoc as Word.Document
    ' In between, instantiate wrdApp (usually try GetObject first, then CreateObject if necessary)
    Set wrdDoc = wrdApp.Documents.Add("newtemplate.dot")

Posting Permissions

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