How to use Outlook's VBA Editor

Last reviewed on August 18, 2014

The steps are the same for all versions of Outlook and all Office applications

It's easy to find code samples on the Internet, but unless you know how to use them, they aren’t going to do you much good.

We're going to assume the code is 100% ready-to-use, not a code snippet that is half complete.

If the code will be run against items in your mailbox or personal folders, you should make a backup of the mailbox or data file, just in case something goes wrong with the code. If the code runs against a specific folder, copying the folder and contents may be enough "insurance", (You should have routine backups regardless, but I know many users don't bother.) At least very least, make a copy of the items in the folder you are running the code against.

Check Macro Security Level

Enable Macros in Outlook's Trust CenterBefore you begin, you'll need to check your macro security setting, otherwise, you'll need to use selfcert.exe to sign your macros to test them.

Outlook 2007 and older: Access the dialog to change the security level from Tools, Macros, Security.

Outlook 2010 and up: File, Options, Trust Center, Trust Center Settings, Macro Security.

It’s highly recommended that you set the Macro Security level to only allow digitally signed macros. Do not choose the Low option (run all, never ask), except during testing. Note that some security software will set it to High and your macros will not run. You may need to restart Outlook after changing the security setting.

Open the VBA Editor

Now you are ready to open the VBA Editor. Press Alt+F11 on your keyboard, or if you are showing the Developer ribbon, click theVisual Basic Editor command to open it. In Outlook 2007 and older, the command in on the Tools, Macros menu.

Visual Basic Editor If your screen does not resemble the screenshot on the right, with the white editing pane open, you'll need to click on Microsoft Outlook Objects to expand it then double click on ThisOutlookSession to open it in the editing pane on the right side.

To add a module to the VBA project, right click on Project1 and choose Insert > Module to insert a new module.

Generally speaking, you can put the code into either ThisOutlookSession or a Module, unless otherwise noted that it must be in ThisOutlookSession or a module.

Application_Start macros must be in ThisOutlookSession.

 

Starting out with Outlook Macros Video Tutorial

This video tutorial shows you have to change the macro security settings, add a macro to Outlook, run the macro, and then create a digital signature using SelfCert.exe to sign the macro before increasing macro security.

Run the Macro

Click the button to run the macroPress F5 or the Run button to run the macro from the VBA editor. (It's highly recommended you make a backup of the folders or message store before running macros.)

Ctrl+Break will pause the macro, or press the Stop button on the toolbar to end it.

If you will be using the macro often, you should use selfcert to sign it then set Macro Security to only allow signed macros.

Don't sign the macro until you are done tweaking it and if you tweak it later, you'll need to re-sign it.

To run the macro from Outlook 2007 or older, go to Tools, Macro, Macros and select the macro. In Outlook 2010, you need to show the Developer ribbon first (File, Options, Customize Ribbon – check Developer ribbon on the right). You can also open the Macros dialog using Alt+F8 (all versions). You can also add macros to toolbar or ribbon buttons.

 

Using SelfCert to sign a macro

Self-sign macros

To sign a macro using selfcert, you first need to create a certificate. You can find selfcert in the folder with your Office files. In Outlook 2010 and older (as well as Outlook 2013 in volume licensing), selfcert is usually at C:\Program Files\Microsoft Office\OfficeXX where XX is your version of Office.

In Outlook 2013 “click to run”, users will find selfcert at C:\Program Files\Microsoft Office 15\root\office15

With any Office version, if you use 64-bit Windows and 32-bit Outlook, selfcert will be in the 32-bit Programs directory.

It's simple to use: just type a name for your digital certificate then click ok.

Once you have the certificate, sign the macros using Tools, Digital Signature dialog and choosing a certificate. When you close Outlook, if you are asked to save the VBA project, click Yes, even if you saved it from the VBA editor.

Note that every time you edit the macro you'll need to resign it.

Add Macros to the toolbar or ribbon

If you are going to be using a macro often, you will probably want to create a toolbar button for it.

Customize Outlook 2010 and 2013 ribbonIn Outlook 2010 and Outlook 2013, you can add buttons to the QAT or the ribbon. Go to File, Options and choose Customize Ribbon or Quick Access Toolbar.

You’ll need to add a new Group to an existing ribbon tab or add a new tab and new group before selecting Macros from the Choose commands from menu. Select the macro and click Add to add it to the selected group in the right pane.

In Outlook 2007 ribbons: you can only add buttons to the QAT. Right click on a ribbon tab and choose Customize Quick Access Toolbar. Select Macros from the Choose commands from menu then select the macro and Add it to the right pane. (When you add buttons to the QAT you can use Alt+n keyboard shortcuts.)

Add macros to the toolbar for easy accessIn Outlook 2007 (main interface) and older versions of Outlook: right click on the toolbar area and choose Customize. Switch to the Commands tab and find Macros on the left.

Drag the macro from the right side to the toolbar and drop. Right click on it to edit the name and button image.

More Information

Need help with sample code? Try the forums at Outlookcode.com or the Microsoft programming forums at MSDN

Looking for sample code? Outlookcode and VBOffice.net have a large number of code samples.

Written by

Diane Poremsky
A Microsoft Outlook Most Valuable Professional (MVP) since 1999, Diane is the author of several books, including Outlook 2013 Absolute Beginners Book. She also created video training CDs and online training classes for Microsoft Outlook. You can find her helping people online in Outlook Forums as well as in the Microsoft Answers and TechNet forums.

Please post long or more complicated questions at Outlookforums.

113 responses to “How to use Outlook's VBA Editor”

  1. john

    hello Diane,
    please can you give me a code that automatically attaches files to out-going emails?

  2. sandy ingram

    Hi Diane,
    Thanks for your macro info.
    I have a customer who wants to be able to click a button from within his outlook client 2010 when he replies to a mail that came from a source that can only send plain text, like a BlackBerry device. He wishes to have all of his outbound mails go out in html format and he is looking for a quick way to do that without the few steps of forcing the reply text to switch from plain text to html. I've read some web posts that mention adding macros in VBA and I've enabled the developer tab on my own outlook 2010 and am trying to create a macro but I lack the actual code to go in the macro. Can you direct me to a site that has code capable of converting all text in outbound mails to html before sending?
    Thanks for any help,
    Sandy

  3. sandy ingram

    Thanks very much Diane,
    This guy wishes to send every outbound mail in html format (instead of plain text) so can I simply change the code line to : oMail.BodyFormat = olFormatHTML
    ? Excuse my code ignorance, would that work?
    Sandy

  4. sandy

    Diane, I never thanked you properly for this. Your code and instructiosn worked perfectly for me, it ended up that my customer could never set it up for himself though as he only ever accessed his outlook via a citrix session which was locked down too tightly. It could only be done in a full outlook client, thanks again, I learnt something. sandy

  5. blaz

    Hi Diane,
    this is what i was looking for. however does not work on my laptop (win8, ms office professional plus 2o1o).
    i did everything exactly as written above (and in the link about macros). when i try to run it a new window opens asking for: select folder. i do select the Contacts folder, i see something is going on (the small circle - ex sandclock), but no result for synched contacts from wp 7.5.
    any ideas what am i doing wrong...
    many thanks

  6. Nancy

    Hi Diane...That cose is the one I have been wanting... but how do I create the New reply button?

  7. Alex

    This tutorial is missing a very important part. Signed macros are not trusted until certificate is added to the "Trusted Publishers" certificate storage. It can be done from the window where you assign certificate to the VBA project. There's a link to "View Certificate" then in the next window you have to click "Import Certificate" and choose "Trusted Publishers" storage for it.

  8. merium

    i want to get all incoming mails to a specific hidden email id at outlook
    can you please help me out and give me the code of this.

  9. merium

    but both codes automatially BCC all messages (http://www.slipstick.com/outlook/email/automatically-bcc-all-message/) and incoming rules are not working simontanously.
    and a atuo bcc all messages is not working in outlook 2003
    kindly help me out

  10. mera

    i cant open my vb by pressing ALT+f11 or by going to macro then vb editor kindly tell me what to do. even i could open before but after pastinjg 2 codes i am unable to edit that.

  11. mera
  12. mera

    kindly tell me in details whcih file to be rename and wht to do next

  13. mera

    how to enabled VBA

  14. mera

    i did the same but still cant open my VB editor

  15. maher

    hi Diane

    right now i need to know that the code (http://www.slipstick.com/outlook/email/automatically-bcc-all-message/) worked at my laptop once but after that its not working there and any where. i tried it at ms outlook 2003, 2007 and outlook express 6. let me know what to do. tell me in details as i am not VB expert but have bit understanding. is there any restriction of domains?

  16. mera

    http://www.slipstick.com/developer/how-to-use-outlooks-vba-editor/#comment-177349
    i used Alt+F11 and went to tools macro then editors as well but couldnt open my VB editors.
    then used your given solution
    Close Outlook. Go to C:\Users\username\AppData\Roaming\Microsoft\Outlook - there is a file called VbaProject.OTM. Rename it to VbaProject.old and restart Outlook.
    but no benefits at all.
    its due to when i enter automatically bcc all messages and http://www.slipstick.com/developer/how-to-use-outlooks-vba-editor/#comment-177208 code togather. kindly solve my problem

  17. merium/maher

    Dear Diane
    yeah i set warning for all macro. and it worked once at my pc but when i tried another code for forwading all messages to a specific id and then delte. i used ths form your site. then it stop working disable my VB eidtor. but the more strange thing when i tried this at my client pc it didnt work. kindly help me out. (i asked this issue as well at your site)

  18. merium

    - you mean to say that i need to set macro security setting at that email id in which i want to receive all bcc messages. so which option should be set
    * warning for signed macro, all unsigned macros are disabled
    (although i checked from webmail that mails are doing bcc or not)
    - one of user http://www.slipstick.com/developer/how-to-use-outlooks-vba-editor/#comment-176791
    asked to add macro on trusted publisher so is it necessary to do?
    - yeah i download to many emails that was my mistake.

  19. merium

    thank alot Diane for such a wonderful description
    its working now.
    - but at one of my domain mails are not sending
    when i try to send email following message is coming form System Administrator.
    Your message did not reach some or all of the intended recipients.

    Subject: nte
    Sent: 6/1/2013 4:02 PM

    The following recipient(s) cannot be reached:

    'abc@domainname on 6/1/2013 4:02 PM
    550 Requested action not taken: mailbox unavailable or not local

    why this is happening to all emaial ids of this domain. kidnly solve this

    - one more thing every time i open outlook a window opens that
    *sing in trusted macro
    *enable all macros
    *disable all macros

    so is there way out to solve this

    Regards

  20. mera

    http://www.slipstick.com/developer/how-to-use-outlooks-vba-editor/#comment-177349
    - i used Alt+F11 and went to tools macro then editors as well but couldnt open my VB editors.
    then used your given solution
    Close Outlook. Go to C:\Users\username\AppData\Roaming\Microsoft\Outlook - there is a file called VbaProject.OTM. Rename it to VbaProject.old and restart Outlook.
    but no benefits at all.
    its due to when i enter automatically bcc all messages and http://www.slipstick.com/developer/how-to-use-outlooks-vba-editor/#comment-177208 code togather. kindly solve my problem
    - i uninstall msoffice 2007 and then intall again but still i am unable to access my VB editor

  21. merium

    hi Diane
    this code is not working on vista
    bcc address is coming on sent items as bcc.
    kindly let me know same code for vista as well
    thanks

  22. merium

    i used following code for auto bcc
    Private Sub Application_ItemSend(ByVal Item As Object, _
    Cancel As Boolean)
    Dim objRecip As Recipient
    Dim strMsg As String
    Dim res As Integer
    Dim strBcc As String
    On Error Resume Next

    ' #### USER OPTIONS ####
    ' address for Bcc -- must be SMTP address
    ' or resolvable to a name in the address book
    strBcc = "one@arktex.co.uk"

    Set objRecip = Item.Recipients.Add(strBcc)
    objRecip.Type = olBCC
    If Not objRecip.Resolve Then
    strMsg = "Could not resolve the Bcc recipient. " & _
    "Do you want to send the message?"
    res = MsgBox(strMsg, vbYesNo + vbDefaultButton1, _
    "Could Not Resolve Bcc")
    If res = vbNo Then
    Cancel = True
    End If
    End If

    Set objRecip = Nothing
    End Sub

    i used obove code in windows XP it works very well. and bcc email id didnt showed in sent items
    but when i used same code in windows vista bcc address showed in sent items as bcc
    kidnly guide me for sending hidden bcc in windows vista.

  23. merium

    same outlook version msoutlook 2007 on both pcs but in windows 7 its showing bcc address in sent mail and in xp its not showing bcc email id in sent item. (sorry having problem in windows 7 not in vista.) kindly tell me the code which i may use on windows 7 and bcc EMAIL address will not show in sent items.
    thanks

  24. merium

    i think there is problem of permissions in windows 7
    thats why bcc emails id are showing in sent itemsl
    kindly tell me to solve the permssion isssues
    ive not get the reply of last post. which has not crossed the moderation yet :(

  25. merium

    but diane in windows xp msoutlook 2007 bcc address is not showing in sent items but in windows 7 its showing. ive tried both.
    let me know the code for windows 7 in which i can hide bcc email ids in sent items.

  26. Nick

    is there a macro that can be added to microsoft outlook 2013 that will allow me more opitions for the flag such as putting a time reminder on them in tasks for mail in my imap inbox - i'm thinking similar to the categories macro that you develops and works just wonderfully!

  27. Phil Reinemann

    MS Word has a learn macro option, but I can't find a learn macro function in Outlook (2007). Is there one? What can I do to learn a sequence of mouse or keyboard operations to create a macro?

  28. Phil Reinemann

    Thank you for responding Diane. (You have always done so promptly from my experience.)

    I have Outlook 2007 set such when I click Send in an email it by default holds it in the Outbox for 5 minutes, which comes in real handy if say, I forget to add the attachment or think of something else to add or say. The default has an exception that if a particular category is selected for the mail it doesn't wait, but does a SendNow.

    Sendnow comes in handy like when I'm talking with someone on the phone and they'd like the info now, instead of in 5 minutes, or when I send an email and then want to leave for the day and exit Outlook right away.

    For that I have a macro with a button assigned in the QAT. The macro pulls up the Categorize dialog, and one of them (the green one) is set to SendNow. I select SendNow and categorize the mail.

    I'd like to bypass the categorize dialog and have the QAT button/macro automatically set SendNow.

    I just don't know enough VB, much less any object oriented programming, to make the code work. (It's a beginner's issue of not understanding the context of what a method or property applies to/affects when there is such a mass of objects, properties, methods and attributes to each little piece of the Office tools. Category for example likely also has categories, and the context is somehow different for any particular method or attribute.)

    By the way, I like the "wait X" in Outlook 2007 much more than 2003's send/receive every X minutes. In 2003 if you said Send, it could go out any time between seconds later and X minutes depending on when the X minutes were up for Send/Receive.

  29. Phil Reinemann

    Here is my current macro assigned to a QAT button. I'll see about fitting in/ replacing it with that snippet you posted. Thanks!
    (Making sense of it all will take a bit more, like figuring out what ActiveInspector encompasses and what CurrentItem is, in the contect of Outlook's received, currently viewed message, to-be-sent message, etc, and why obj.Categories is used insteadof obj.Category (as only one category seems to make more sense). So says a sequential programmer while learning OO. Did you pick "SendNow" because that's what I posted earlier, or because that's what the other user used?

    'by Michael Bauer
    'http://vboffice.net/sample.html?lang=en&mnu=2&smp=53&cmd=showitem
    Public Sub ShowCategoriesDialog()
    Dim Mail As Object
    Set Mail = Application.ActiveInspector.CurrentItem
    Mail.ShowCategoriesDialog
    End Sub

  30. Phil Reinemann

    I followed the "add a category on send" link you posted and that helps a bit overall to put things together, such as you you posted SendNow, but I still have a ways to go!
    Again, thanks!
    (I wish these "Leave a Reply" boxes had elevator/scroll bars!)

  31. Julia

    Hi there I have entered a vba code to bcc all sent messages, but its only working for one of my 3 email accounts in outlook 2010

  32. Jay

    Hello Diane,

    I would like to send a generic holiday greeting that I created via email to ALL of my contacts. I also would like to include those address that I have received emails from that I have not yet saved to contact but are in my inbox. Is it possible to do this without having to individually type/copy email addresses to each recipient and send?

    Thanks in advance for your help.

    Jay

  33. Clint Clarkson

    Hi Diane:

    I would like to have a VBA macro that identifies when an attachment has not been attached. I have found one online, but when it is added to "ThisOutlookSession," it stops working after Outlook is closed and re-opened. Is it possible to attach a macro to all Outlook sessions?

  34. P Reinie

    Clint, where did you find the code to do this? What triggers it - do you send every message with an attachment?

    I found that if I attach what I want to send before I put in the text of the email I haven't had a problem, but I know how it goes.

  35. Alex Noshe

    Hi Diane,
    Is it possible to write a VB code on one machine that will be available on another machine with the same account?
    I have a PC and a laptop and I want to be able to write code only on PC so that laptop is updated automatically (say, VBA code and Ribbon customization)

    Thanks in advance!

  36. Alexander Noshe

    Thanks for reply.
    Diane, what about roaming locations for my account? Say, the folder that keeps coding and ribbon customization to put in server for my account...
    Makes any sense? Can help?

  37. Jenny Bond

    I wish Outlook would write macros for me like Word does! I don't know how to write VB but would like an Outlook macro which filters address cards for me, taking me to the place where you type in the category:

    View, view settings, filter, advanced, in the field drop-down menu select frequently used fields and categories, type

    Then all my colleagues would have to do is click 'add to list' and 'OK' and 'OK'. (Unless you can do a macro which does those bits for them afterwards as well, but I suspect that is not possible.) It would also be helpful to have a macro which would then clear all categories! Is there something available online please or some idiot's guide which would tell me how to write it? Thank you.

  38. Rudy

    Hi Diane, First, Thanks for such a helpful article. I had couple of questions where in I needed advice from a VBA expert and was wondering if you could help.

    - I need to write VBA macro that runs on Outlook to generate Auto-Reply email. This has to be an auto-reply to EVERY single email that enters into the Inbox. Out of office reply will not work for this scenario :).
    So, I did write up some code to generate this reply but I want the macro to run always regardless of whether the Outlook session is open on the server or not. Is that possible?? Please advice.

    - Is it possible to generate a unique auto-reply email out of two different mailboxes that are configured on one Outlook client? I know it is weird but this is a real time scenario.
    Auto-Reply 1 from Mailbox 1, Auto-reply 2 from mailbox 2.

    How would we code this?

    Thanks.
    Rudy

  39. Anas

    Hi Diane, Can u please provide me a program code in outlook, which reads the email subject line,word by word and stores each word in the text file..

  40. Yair

    Hello
    Is it possible to add a file attachment (as an icon) to a mail message using a macro?
    Thanks in advance
    Yair

    Sub ניסיון()
    Set msg = Application.CreateItemFromTemplate("C:\Documents and Settings\y_amoyal\Application Data\Microsoft\Templates\ניפוק כימיקלים חודשי-בנק הדם.oft")
    msg.Display
    Attachment.Add "P:\ניפוק חודשי למעבדות\בנק הדם.xls"

    End Sub

  41. Yair

    Hi again
    Thanks for your reply, but I did not understand your tip.
    My aim is to open a template mail, with .xls attachment that is in specific address (which I update outside that)
    Regards,
    Yair

  42. Yair

    It works!
    Great Thanks!
    Yair

  43. Yair

    Diane, is it possible to ask about XLS files too?

    I am trying to open a sheet with next month date, such as "3-2014" (m-yyyy)
    Cannot find the mistake. I am on it for few months already...

    Thanks in advance

    Dim m As Variant
    Dim y As Variant
    Dim dt As String

    Dim newDate As Date

    newDate = DateTime.Now + Month(1)

    m = Month(newDate)
    y = Year(newDate)
    dt = CStr(m) + "-" + CStr(y)

    On Error Resume Next
    If Sheets(dt) Is Nothing Then
    newDate = DateTime.Now + Month(1)
    m = Month(newDate)
    y = Year(newDate)
    dt = CStr(m) + "-" + CStr(y)
    ActiveSheet.Name = dt
    dt = ""

    Else
    MsgBox ("There is a sheet already named with next month date.")
    End If

  44. Yair

    Thank you very much, Diane. It works. But you know that already.
    thanks again
    Yair

  45. Nikeita P.

    I created a custom form to be used to take messages in our office. I saved the template on our server so that our employees can add the form to their outlook folder. I believe the problem I am having is maping the macro to the folder on our server where the template is located. Can you take a peek at my code below and let me know where I am going wrong?

    Sub DisplayForm()
    Set myFolder = Session.GetDefaultFolder("X:/Resources")
    Set myItem = myFolder.Items.Add("Phone Message.oft")
    myItem.Display
    End Sub

    Thanks for all your help in advance Diane.

  46. Paul

    Every time I run ( |> button ) the macro I get a dialog to name it. Any ideas what I'm doing wrong. Please keep the answer simple, I'm a newbie w/VBA

  47. Yair

    Hi Diane
    The problem still occurs.When I tried to run the Macro today it still give the MsgBox.
    Any other ideas?
    Regards,
    Yair

  48. Phil Reinemann

    Yair, (from March 9, 2014 at 5:49 am) use your message box to output the dt string then check if it exists already.
    I found it too weird to debug using msgbox month(1) so I'd use:
    nowDate = DateTime.Now
    m = Month(nowDate) + 1
    and similarly for the year to get the sheet's name-string.

  49. Mary

    Hi Diane, your website is very helpful! I have an VBA-script that I cannot get working everywhere. The problem seems to be with the digital signature. What I've done is that I've created the signature with selfcert.exe, then exported/imported it through Internet Options into trusted root certification publishers and trusted publishers.
    Then I opened Outlook Trust Center and made sure the certificate was added to Trusted Publishers there. Then I assigned this signature to the VBA project.

    In Outlook, the security settings are set to 'all unsigned macros are disabled', and we want to keep it that way.

    Whenever I open the VBA editor, it does not do anything, the script does not run if I make it. If I set the security setting to 'always ask', it shows a warning when I open the VBA editor, but I don't get the option 'Always trust this publisher' (it's greyed out). If I manually say that the macro should run that time, it works fine. So, the problem is not with the VBA project itself, but with the security surrounding the digital signature.

    How do I get the VBA project to run, with the 'all unsigned macros are disabled' settings? What can I do to pass the security warnings?

    This system is running Outlook 2013/Win7.

    Thanks so much for your help already!

  50. Phil reinemann

    Could the sheet be in the Personal.xlsb instead of in the main xlsm document?

  51. Phil Reinemann

    My last question about the sheet in Personal.xlsb is about Yair's code to make a new excel sheet.

  52. Yair

    Do you mean nowDate or newDate? my Macro us indeed in the Personal xlsb. is it a problem?
    I need a guidance for implementing your suggestion...
    Thanks
    Yair

  53. Phil Reinemann

    Yair, I used nowDate because it retrieves the current time, and from that newDate is computed. Give it whatever names you want.

    I was wondering if the sheet that your code detects as already existing is a sheet in your Personal.xlsb instead of in the workbook where you created the new sheet.

    So in your test for existance "If Sheets(dt) Is Nothing" perhaps you should specify the workbook where you created the sheet to make sure you're looking for the sheet in the right workbook.

    I only see the code you originally posted so I can't help you more.

  54. Emmett McAuliffe

    Hi Diane.

    Was wondering if there was a code to search everything that might've happened in Outlook on a particular day: Received, Sent, Modified, Created ... more? Advance find seems to only produce an "AND" result. So you really have to perform those searches separately and compare the results (you get a lot of duplication).
    Thanks for any help you can give.

  55. Emmett McAuliffe

    Thanks Diane. I will for sure take a look at Query Builder. To answer your question about why anyone would need this, ... advanced find allows you to "To find more criteria" , ... then conveniently "add [it] to list" but it only does so only with the operator AND. I need the operator OR. I can add unlimited criteria (a good thing)... but it will only find Outlook Items that match ALL of those criteria not ANY of them (like most query engines work ... for example , the search engine I use every day as a trademark lawyer http://tmsearch.uspto.gov/bin/gate.exe?f=searchstr&state=4809:z3diok.1.1 where it assumes that you want the operator OR ... and you have to manually change it.)

    For example, in a Venn diagram, if a red balloon in a blue balloon overlap, Microsoft Outlook will only let you see the purple overlap area, it will not show you the entire area of the red balloon and the blue balloon.

  56. Emmett McAuliffe

    So what I'm finding is that by "Modified", Outlook means "last modified". Therefore, if an email was received on say March 17, but modified with the flag (for example), on March 31, it will not show up in a search for "modified on March 17".

  57. Gary Davis

    My outlook script runs and adds a Subject when I hit "yes". However sometimes I hit yes to quickly so I would like to require to ask one final time Send Email Y or N. And have it default to Yes so I can just hit Enter and it will send or N for No.

  58. Paul Grace

    Hiya Diane -

    Wonder if you can help? We are attempting an auto-reply of different styles of incoming email:
    a) Where a pdf attachment (timesheet) is received: to email back confirmation of receipt (along with the pdf itself so the send knows what we have received).
    b) Where a holiday refund request is received - no attachment.

    In both cases the sender's email address is within the email body (generated via a corporate website add-on). Seems to be causing brain cells to explode without an answer. :-)

    Many thanks -

    Paul

  59. u01brb2

    Hello,

    I have been trying, in outlook 2010, to create a macro that i can add to the QAT with a drop down menu to choose my template emails. I managed this last year then had my computer rebuilt and forgot the code! Currently i have a different icon for each template on my QAT, i would rather have a dropdown menu to choose a specific email template - does anyone know the code? Currently i am using:

    Dim template As String

    Sub OpenTemplate1()
    template = "C:\Users\benbarclay\AppData\Roaming\Microsoft\Templates\safetytalks.oft"
    MakeItem
    End Sub

    Sub OpenTemplate2()
    template = "C:\Users\benbarclay\AppData\Roaming\Microsoft\Templates\Your Online Preview of SafetyTalks.oft"
    MakeItem
    End Sub

    Sub OpenTemplate3()
    template = "C:\Users\benbarclay\AppData\Roaming\Microsoft\Templates\SafetyTalks New Training.oft"
    MakeItem
    End Sub

    Sub MakeItem()
    Set newItem = Application.CreateItemFromTemplate(template)
    newItem.Display
    Set newItem = Nothing
    End Sub

  60. Rex

    Just a friendly buzz for your valuable materials posted in this page so that I have made use of it in my working area :)

Leave a Reply

If the Post Coment button disappears, press your Tab key.