+ Reply to Thread
Results 1 to 4 of 4

Create a macro in Outlook

  1. #1
    Registered User
    Join Date
    08-02-2006
    Posts
    16

    Create a macro in Outlook

    Hi,

    I have only a basic knowledge of macros - and I have only used them in Excel and Access. In Excel 2003 I often RECORD a new macro, then assign it to a new custom button on a toolbar. I'm afraid I would have no idea how to "program" a macro using code.

    But now I need to do just that in Outlook 2003. Trouble is , I searched "Help" and it says you cannot record them. So I need REAL help.

    I have created a message template for a particular recurring task and there are about 20 staff who will need to use it (most of them less technically advanced than me - you see the problem!!). Now, according to HELP there are three steps to using this template:
    1. In the Inbox folder in Outlook, on the Tools menu, point to Forms, and then click Choose Form.
    2. In the Choose Form dialog box, click the Look in drop-down arrow, and then click User Templates in File System.
    3. Select your template, and then click Open.

    These are the three steps I would like to automate using a macro. Then, ideally, I would like to be able to create a new button on the toolbar, which would run this macro.

    If successful, I presume I will have to go and do the same on all the users' PCs, but I could live with that. I need to make this as easy as possible for them, as they'll all need to use the template every week.

    I'd be very grateful for any help.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello BigPat,

    This is pretty simple to do, once you know how. First, you need to create a digitally signed certificate. You won't be able to run the macros in Outlook without it. This is the most complex part of the procedure here is how to create your digital certificate. You may want to print this for reference.

    Program Location:
    For Office 2003:
    ?:\Program Files\Microsoft Office\OFFICE11\SELFCERT.EXE

    For Office XP:
    ?:\Program Files\Microsoft Office\OFFICE10\SELFCERT.EXE

    etc.

    If you do not have the SELFCERT.EXE program you can find it on
    your office CD or you can run setup again and install the Office
    Tools.

    Create the Digital Signature
    Run the program and follow the simple step. It will create the
    Digital Signature or "Certificate" for your vba projects.

    Then in the VBA editor click Tools > Digital Signature... and click
    Choose button and select the certificate you just created.

    This will attach the signature to the project.

    You can also set the security on Excel to High - only signed macros
    from trusted sources will be run.

    So only your macros will run.


    To make you Digital Signature Certificate "Trusted"...

    Export the Digital Signature
    After you create your D.S. view it like when you assign the D.S. to
    your VBA project - Tools > Digital Signature > Choose... > Select
    your certificate > View Certificate > Details Tab > Copy to file...
    Then you will see the Certificate Export wizard. Click Next > Next
    > Next > Browse to where you want to save it to (*.cer) > Next >
    Finish.

    Import the Certificate
    Browse to where you exported the certificate to and double click
    it and wait for it to display the certificate. Then click Install
    Certificate... > Next > Select "Place certificate in the following
    store." and browse to "Trusted Root Certification Authorities" >
    Next > Finish > Yes. Then your done.

    Then check your VBA project's Digital Signature and it should
    show that it is now "Trusted". If not, remove the Digital Signature
    and then re-attach it to your VBA project again. You wil no longer
    see the little red circle x before the certificate name.

    Macro Code
    This will create the button to "Choose a Form".
    Please Login or Register  to view this content.
    Adding the Macro
    1. Copy the macro above pressing the keys CTRL+C
    2. Open Outlook
    3. Press the keys ALT+F11 to open the Visual Basic Editor
    4. Press the keys ALT+I to activate the Insert menu
    5. Press M to insert a Standard Module
    6. Paste the code by pressing the keys CTRL+V
    7. Make any custom changes to the macro if needed at this time.
    8. Save the Macro by pressing the keys CTRL+S
    9. Press the keys ALT+Q to exit the Editor, and return to Outlook.

    Outlook Startup Event Macro
    Please Login or Register  to view this content.
    Installing the Event Macro
    1. Copy the macro using CTRL+C keys.
    2. Open Outlook
    4. Press ALT+F11 keys to open the Visual Basic Editor.
    5. Press CTRL+R keys to shift the focus to the Project Explorer Window
    6. Press the Down Arrow Key until ThisOutlookSession is highlighted in blue.
    7. Press the Enter key to move the cursor to the Code Window
    8. Paste the macro code using CTRL+V
    9. Save the macro in your Workbook using CTRL+S

    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    08-12-2010
    Location
    Boston
    MS-Off Ver
    Office 2007
    Posts
    3

    Re: Create a macro in Outlook

    Hi,
    I have the same question, but wanted further instruction on how to extend some defaults:

    when the choose Form pop-up comes up.
    How do i make it look in the User Templates in File System instead of the Organizational Forms Library?

    Also is there a way to choose a specific saved template from the file system?


    thank you,
    Amit.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Create a macro in Outlook

    Welcome to the forum,

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1