Link to home
Start Free TrialLog in
Avatar of webspeedway
webspeedway

asked on

Outlook 2007: Macro - Open Msg in Forward form, then over to a folder

I have looked and looked for a macro to open the current selected message in message view, and once I forward then move to a archived folder. In other words I'm looking for a Delegate Macro for messages that I'm delegating to someone else (not always the same person) and then wanting to archive for search purposes. Thoughts?
Avatar of David Lee
David Lee
Flag of United States of America image

Hi, webspeedway.

While it's possible to do this the way you described, there is a simpler approach.  Instead of keying on forwarding a message, how about a macro that handles the forward and archive all at once?  In other words, you have a "Delegate" button that when clicked forwards the message to the delegate and archives it?
Avatar of webspeedway
webspeedway

ASKER

Yeah that would work, would you juts prompt for a name out of address book? Because it will not always be the same person..    Also i will make another question so you can get points also, but what do you think about a file button also that marks the msg read and moves to the folder designated in the code??
ASKER CERTIFIED SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
"... what do you think about a file button also that marks the msg read and moves to the folder designated in the code??"

That's simple.  Send me a link to the question when you open it and I'll post a solution.
BlueDevilFan, I installed the code but the folder link is not setup the way I'm use to.. Can you give me some insight?
        'Change the folder path on the following line'
        Set olkFolder = OpenOutlookFolder("Inbox\2009")
        olkMsg.Move olkFolder

Open in new window

Is the folder 2009 under the default inbox?
Yes
Change line 17 from

    Set olkFolder = OpenOutlookFolder("Personal Folders\Archive")

to

    Set olkFolder = Session.GetDefaultFolder(olFolderInbox).Folders("2009")

You can also delete the OpenOutlookFolder and IsNothing functions.
Perfect, works.. But i thought of a issue.. I usually write something in the e-mail that I'm delegating.. Any way to either show the fwd msg before it sends or add a line of text? Sorry..
Which do you prefer?
Change line 15 from

    olkForward.Send

to

    olkForward.Display

You'll have to click Send manually.
BlueDevilFan, I'm getting a debug error now..

Run-Time Error '91'
Obeject variable or With block variable not set

It references the following:
    Set olkMsg = Application.ActiveInspector.CurrentItem
You have to have an item open for that one to work.  I can change that if you want.
Yeah, i will be running from the main inbox voew with preview on.
Ok.  Change this line

    Set olkMsg = Application.ActiveInspector.CurrentItem

to

    Set olkMsg = Application.ActiveExplorer.Selection(1)