Reply Macro using O365 Connected Account

Markj

Member
Outlook version
Outlook 2013 32 bit
Email Account
Exchange Server
Background: I have a client with an Office 365 account, which has a POP account connected to it, as (well...) a "connected account". The connected account is also set to forward email to the O365 account so she receives those messages more frequently than the hourly synchronization that O365 does. This has introduced a problem where all Reply messages default to using the O365 account's email address, not the POP email address. She can choose the connected account email address from the "From" field dropdown list, but she manages tons of emails a day and finds that inconvenient. Interestingly, all other clients which have connected accounts do not also forward email from the connected account, and the reply "From" email address correctly defaults to that connected account email address.




I've tried a macro to force the reply action to use the connected account's email address, but it results in send failures. Here's the code:




Code:

 
 

 
 
Public Sub BHGReply()
 
 

 
 
Dim objMsg As MailItem

 
 
Set objMsg = Application.ActiveExplorer.Selection(1).Reply
 
 
'Set objMsg = Application.CreateItem(olMailItem)

 
 
With objMsg
   
   '.From = "her.email@connectedaccount.com" --NOTE: this just fails as invalid...
 
 

   .SentOnBehalfOfName = "her.email@connectedaccount.com" '--NOTE: this line results in "Your message did not reach some or all of the intended recipients. blah blah... This message could not be sent. Try sending the message again later, or contact your network administrator.  Error is [0x80070005-00000000-00000000]."
 
 

   .Display
 
 
End With

 
 
Set objMsg = Nothing
 
 
End Sub





Any ideas? Thanks much.
 

Markj

Member
Outlook version
Outlook 2013 32 bit
Email Account
Exchange Server
Perfect solution! Thanks very much!!
 
Top