Results 1 to 9 of 9
  1. #1
    3 Star Lounger
    Join Date
    Oct 2002
    Location
    Ross-on-Wye, Herefordshire, United Kingdom
    Posts
    212
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Change From Address in Reply (Outlook 2003+)

    When I hit Reply / Reply All, I want something to look at the original TO address and use that as the FROM address.

    The To/From address is an already pre-defined POP3/SMTP account – Yes, I know I can manually select the From address in the drop down list in the Reply form/screen, but I want it to be automatic, unless I otherwise change it.

    Background – We (my wife and I) are looking to switch to a Hosted Exchange Service, after several years of running via Outlook pst files. Currently if we receive an inbound message to one of the dozen or so e-mail address that we each monitor the default reply FROM address is automatically set to the original inbound Recipient’s address – Unless we choose to change it. I/we would like to retain that functionality once we switch to Exchange.

    We can set up Exchange aliases associated with POP3/SMTP accounts so we can MANUALLY select the account from the pre-configured POP3/SMTP list of accounts – You configure these accounts to never collect via POP3.

    What I’d like to be able to do is to automatically have Outlook default the From address to the original To address – Unless I/we choose to change it.

    Quite happy for this functionality to appear on a New/custom toolbar buttons, but the ultimate would be to replace the functionality of the standard Reply/Reply All buttons.

    Is there something out there that already does what I need? If not, is what I want feasible and if so, where do I start? Never coded VBA in Outlook, done lots of stuff on Excel and WordBasic in my dim and distant…

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Change From Address in Reply (Outlook 2003+)

    You can set the SentOnBehalfOfName of an e-mail message in VBA, but you cannot change the From name, for security reasons.

  3. #3
    3 Star Lounger
    Join Date
    Oct 2002
    Location
    Ross-on-Wye, Herefordshire, United Kingdom
    Posts
    212
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change From Address in Reply (Outlook 2003+)

    Thanks Hans... Hadn't considered the security implications... Harumph!

    Maybe have to consider Zimbra over Hosted Exchange.

    Cheers
    Peter

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Change From Address in Reply (Outlook 2003+)

    In the scenario, will the Account button still be present? If so, you could access the button as part of the CommandBarControls collection. Here is some code I posted a few years ago that displayed a choice to the user. If you capture the account information from the inbound message, then you might be able to automate the setting of the account for the outbound message. Worth a try?

    Re: Prompt for Account (2003)

  5. #5
    3 Star Lounger
    Join Date
    Oct 2002
    Location
    Ross-on-Wye, Herefordshire, United Kingdom
    Posts
    212
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change From Address in Reply (Outlook 2003+)

    Hey, I can't see why the Account button wouldn't be present - The accounts are defined as POP3/SMTP addresses and so are available for selection, allegedly.

    Can you/anyone else point me at a piece of code to discover the To: address in the original inbound e-mail?

    Functionally, I guess what I need to do is create a custom Reply button which when the user clicks it:

    1 - Discover's the To: address.

    2 - Run's your code (amended) and looks for the Account that matches the To: address, and sets this as the From address.

    3 - No need for the user to select anything, I want to enforce the account selection.

    4 - If the user wants to use another account, they can manually select it from the drop down Accounts list anyway.

    At some future point, when feeling brave, replace the functionality of the installed Reply and Reply all with the above.

    Thanks for your input.

    Cheers
    Peter

  6. #6
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Change From Address in Reply (Outlook 2003+)

    Assuming you are viewing the message, then the address fields will be a property of the <code>ActiveInspector.CurrentItem</code> (a MailItem). If you are viewing a folder, then you might be able to use <code>ActiveExplorer.Selection(1)</code> (a MailItem) but I haven't tried it. Also, if it's an appointment request, I'm not sure my code will work property.

    Look for this property: <code>MailItem.SenderEmailAddress</code>

  7. #7
    3 Star Lounger
    Join Date
    Oct 2002
    Location
    Ross-on-Wye, Herefordshire, United Kingdom
    Posts
    212
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change From Address in Reply (Outlook 2003+)

    Cheers for the hints.. Once I've finished moving domains arund and setting up mailboxes I'll have a look at this.

    Peter

  8. #8
    3 Star Lounger
    Join Date
    Oct 2002
    Location
    Ross-on-Wye, Herefordshire, United Kingdom
    Posts
    212
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change From Address in Reply (Outlook 2003+)

    Does anyone know how to establish the e-mail address, not the Friendly Name but the actual e-mail address the original inbound message was sent to?

    You can use mailitem.to - but that isn't going to help you if there are multiple recipients, because it returns a string containing all of the recipients and, you only get the actual e-mail address if the receipient doesn't have a Friendly Name that was used.

    Cheers
    Peter

  9. #9
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Change From Address in Reply (Outlook 2003+)

    Use the Recipients collection; each Recipient object exposes an Address property. However, I don't recall the current user being specially flagged in this collection.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •