Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / January 2006

Tip: Looking for answers? Try searching our database.

Forward or reply using other account

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Catalin - 17 Jan 2006 12:51 GMT
Hello,

I have some rules which forwards incoming email messages based on the sender
name and subect to another address.

My problem is that I would like to forward the messages using a certain
account, not the same like the incoming accouunt. This cannot be done with
rules... I've tried.

Maybe there is a VBA code that can do something like that.

Thanks in advance for any suggestion,
Eric Legault [MVP - Outlook] - 17 Jan 2006 20:52 GMT
You can't change the sending account using the Outlook Object Model, but you
can automate the selection of the account in the dropdown on the Standard
toolbar, provided you open the e-mail first:

Sub ChangeSendingAccount()
   Dim objCBPU As Office.CommandBarPopup
   Dim objCBB As Office.CommandBarButton
   
   Set objCBPU = ActiveInspector.CommandBars.FindControl(, 31224) 'get
Accounts button on Standard toolbar
   
   'Get menu item by name or index number
   Set objCBB = objCBPU.Controls.Item("&1 Microsoft Exchange Server")
   'Set objCBB = objCBPU.Controls.Item(2)

   objCBB.Execute
   
   Set objCBPU = Nothing
   Set objCBB = Nothing
End Sub

Signature

Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/

> Hello,
>
[quoted text clipped - 8 lines]
>
> Thanks in advance for any suggestion,
Catalin - 18 Jan 2006 09:58 GMT
Thanks very much.
But pls explain me some more... I am a newbie with VBA.
How do you make it work? I've tried to run it from inside of VB Editor but I
get an error.
How do you refer to the routine?

Thanks in advance

Catalin



> You can't change the sending account using the Outlook Object Model, but you
> can automate the selection of the account in the dropdown on the Standard
[quoted text clipped - 29 lines]
> >
> > Thanks in advance for any suggestion,
Eric Legault [MVP - Outlook] - 18 Jan 2006 16:28 GMT
You should be able to call the procedure as is, however you do need to set a
reference to the Microsoft Office Object Model in the References dialog in
the VBA editor.

Signature

Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/

> Thanks very much.
> But pls explain me some more... I am a newbie with VBA.
[quoted text clipped - 41 lines]
> > >
> > > Thanks in advance for any suggestion,
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.