Create Macro to Automatically Sign You into Outlook when Using RPC Over HTTP

Compuwise
If you use Remote Procedure Call (RPC) over HTTP in Outlook to retrieve your Exchange email, then you probably know the frustration of having to manually type in your password the first time you log in for the day. This may not sound like a big deal to some but it is an annoyance.

There is a quick and easy solution to get around the problem. A simple macro in Outlook can do the trick.

Here is what you do to create and use the macro:

First you will need to create a digital certificate.

Goto your Microsoft Office Tools directory (usually under Start + All Programs) and open the Digital Certificate for VBA Projects tool. Enter a desired name for the certificate and click ok. You should get the message that you have successfully created a digital certificate.

For this guide my certificate is named AutoEnterPassword

Now open and log into Outlook manually, goto Tools + Macro + Macros and click Create. This opens Microsoft Visual Basic.
Copy and paste the script below into the Macro, replacing what is already there by default:

'script starts here
Sub AutoExec()
'on error goto err

SendKeys "password", 5000
SendKeys "{Enter}"

'err:
'msgbox "Unable to sign into outlook, please use manual signon!"

End Sub
'end of script

Where I have "password", you need to input the password for your email account.

While still in the VBA editor click Tools + Digital Signature + Choose and select the certificate you just created. Click ok to confirm your choice and close the VBA editor. Also go ahead and close Outlook. An alert should pop up, asking you if you want to save the VBA project. Click Yes and save the macro as AutoExec. Click to confirm. Outlook now closes.

We are almost done. Open Outlook and you should get a security message asking if you want to enable macros. You do, so click the Enable Macros button and put a check in the box to confirm.

Close Outlook once more. Wait a few seconds to make sure it has completey shutdown.

We are done configuring the Macro.
Open Outlook again to test the feature. The login box should popup and the password field automatically populate. You are logged into Outlook!

Unfortunately, if your network connection fails for any reason, you will have to manually reconnect and log into Outlook or close and reopen it to allow the macro to enter the password again. All-in-all this is a nifty little trick that can save you from the initial pain of logging in manually. Have fun!

Published by Compuwise

Currently pursuing a Bachelors of Science in Information Technology at Kaplan University online.  View profile

11 Comments

Post a Comment
  • Mark2/4/2008

    Does this submit the supplied credentials in any profile or only the Outlook profile where it was created?

  • Abby Johns1/19/2008

    I completely lack computer savvy, yet it is still very interesting to read your articles!

  • Sussy1/11/2008

    You are so way over my head...but I suspect I can learn a great deal from your articles! :>)

  • Daniel Dunkin1/11/2008

    Great info, thank you.

  • Cheryl Loux1/10/2008

    Interesting article. But I am a bit technology challenged.

  • Lenora Murdock1/10/2008

    Very informative article~

  • Pam Gaulin1/10/2008

    Good info!

  • jcorn1/10/2008

    You really made this easy to understand, even for the technically fearful person like me.

  • Lemaster251/9/2008

    You offer great information. Thanks for the article.

  • Erin Morris1/9/2008

    great information...obvisouly you are very computer savvy, i am not so much, but its still fun to read your stuff and learn new things!

Displaying Comments
Next »

To comment, please sign in to your Yahoo! account, or sign up for a new account.