PDA

View Full Version : Outlook 2010 VBA to attach file



riot
04-28-2010, 02:17 PM
Hello. I found a nice article on using VBA to remind you to attach a file, I tried using it in Outlook 2010 and it did not work. I emailed the author of the article and he replied that the code is different for the new ribbon interface, and supplied code that should work with 2010. It isn't working, and it has us both stumped. The piece of code that isn't working is this:

Application.ActiveInspector.CommandBars.FindControl(, 6003).Execute

6003 is the Control ID for the AttachFile command. Funny thing is, replace the 6003 with 2505 (the Control ID for the AttachItem command) and it works perfectly, bringing up a dialog box allowing you to select an Outlook item for attachment. All the documentation says that 6003 is the correct code for the attachment feature, it just doesn't work though. Anyone have any ideas? Thanks!