troubleshooting Question

Outlook 2003 VBA, attach file from a certain folder

Avatar of tomnj2005
tomnj2005 asked on
Outlook
3 Comments1 Solution607 ViewsLast Modified:

When sending an email message the paperclip button opens the "Insert File" dialog box. I want to write my own code to do that.

I found the "Insertfile method" which will automatically insert a file. However I want to be able to pick a file every time from a file list.

What I really want is to be able make a few different insert file buttons. Each one will always go to a certain folder. The built in button (the paperclip) always goes to to last used folder. I do a lot of attaching, and I am sick of the extensive folder tree hunts I have to do to attach files.

I use Word as me email editor.


This is one solution that doesn't work:

Sub Attach1()

    ChangeFileOpenDirectory _
        "C:\Documents and Settings\tsuser\My Documents\Solutions\Invoices\"

    SendKeys "%IL", True
    'The above line should send Alt+I, wich opens the insert menu, and then the L selects the "file..." menu item.
End Sub

When I run that macro the "Mark Citation" box opens.

However when I manualy type Alt+I, L the proper dialog box opens.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros