Advertisement

07.23.2008 at 12:16PM PDT, ID: 23589789
[x]
Attachment Details

Forward macro in Outlook 2007

Asked by aonecomputers in Outlook Groupware Software

Tags: , ,

I used to have a macro that worked fine in Outlook 2003 but just upgraded to Outlook 2007 and they no longer work. I have the below macro activated by a button in the toolbar so if I want to forward an email I just click the button. It uses the exemption code which I have heard I no longer need.
The error I am getting is Can't find project or library in the line:
Set myForwarditem = myItem.Forward

Thanks for any helpStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
Public Sub Application_Startup()
 
   ' Reference the items in the Inbox. Because myOlItems is declared
   ' "WithEvents" the ItemAdd event will fire below.
   Set myOlItems = Outlook.Session.GetDefaultFolder(olFolderInbox).Items
 
End Sub
 
Sub Forward2Ed()
 
    Dim myOlApp As New Outlook.Application
    Dim myItem, myForward As Object
   
    Set myItem = myOlApp.ActiveExplorer.Selection.Item(1)
    Set myForwarditem = myItem.Forward
 
    myForwarditem.To = "ed@xxxxx.com"
 
    myForwarditem.Save
    Set objSafeMail = CreateObject("Redemption.SafeMailItem")
    objSafeMail.Item = myForwarditem
    objSafeMail.Send
 
   
    Set myItem = Nothing
    Set myForward = Nothing
    MsgBox "Message Forwarded" ' I would include this line for testing
 
End Sub
[+][-]07.23.2008 at 02:33PM PDT, ID: 22074136

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Outlook Groupware Software
Tags: Microsoft, Outlook, 2007
Sign Up Now!
Solution Provided By: DavidT543
Participating Experts: 2
Solution Grade: A
 
 
[+][-]07.23.2008 at 05:12PM PDT, ID: 22075097

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.24.2008 at 01:01PM PDT, ID: 22082940

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628