A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Forward or reply using other account



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 17th 06, 12:51 PM posted to microsoft.public.outlook.program_vba
Catalin
external usenet poster
 
Posts: 15
Default Forward or reply using other account

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,
Ads
  #2  
Old January 17th 06, 08:52 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default Forward or reply using other account

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

--
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/


"Catalin" wrote:

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,

  #3  
Old January 18th 06, 09:58 AM posted to microsoft.public.outlook.program_vba
Catalin
external usenet poster
 
Posts: 15
Default Forward or reply using other account

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




"Eric Legault [MVP - Outlook]" wrote:

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

--
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/


"Catalin" wrote:

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,

  #4  
Old January 18th 06, 04:28 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default Forward or reply using other account

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.

--
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/


"Catalin" wrote:

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




"Eric Legault [MVP - Outlook]" wrote:

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

--
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/


"Catalin" wrote:

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,

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Spell checker / ignore original message in reply or forward coopfab Outlook - General Queries 9 January 3rd 07 06:56 PM
I cant write/reply or forward email, or open calen, can ONLY read laura Outlook - Installation 3 February 27th 06 07:55 PM
cannot auto forward from non default account Lightkeeper Outlook Express 0 February 17th 06 03:20 PM
Reply and Forward arrows missing malc Outlook - General Queries 0 February 9th 06 09:41 AM
Reply/Forward Keeps Running Thread in one Message Instead of Separ Delnang Outlook - Using Forms 0 January 9th 06 03:27 PM


All times are GMT +1. The time now is 10:31 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2024 Outlook Banter.
The comments are property of their posters.