Use Macro to change account settings

Matt Metz

Member
Outlook version
Outlook 365 64 bit
Email Account
IMAP
I have an email account on my provider's email server whose USERID is custom@[mydomain].com. In Outlook 365, I have this account set up to send only - not receive. I use this because when doing business with a new website (newsite.com) I use newsite@[mydomain].com as my email address. When the people at newsite.com respond, their messages to me arrive in my wildcard (catch-all) email account.

If I then need to correspond with newsite.com by email, I change the Outlook email settings for custom@[mydomain].com so that the outgoing message appears to come from newsite@[mydomain].com and the return address is also newsite@[mydomain].com.

This takes many steps, and I would like to have a macro (triggered by a customized button on my Outlook HOME ribbon, which I already know how to do) that does this.

When I do this manually (actually, I'm using mini mouse macro to accomplish this) the steps are generally as follows:

1. Copy the custom email (newsite@[mydomain].com) into Windows clipboard. (I am prepared to continue to do this manually, outside the macro.)
2. Gain access to the email account settings in Outlook (File > Account Settings > Manage Profiles > Email Accounts)
3. In the ACCOUNT SETTINGS dialog box, on the EMAIL tab, select the account associated with custom@[mydomain].com and click CHANGE. Note: this cannot be identified by the NAME field in this dialog box because the NAME field was customized by the prior use of this process. It can be identified by looking at the data file associated with the account, which is C:\users\[myname]\AppData\Local\Microsoft\Outlook\custom@[mydomain].com.ost.
4. In the CHANGE ACCOUNT dialog box, change fields as follows:
4a. User information > Email address > paste the clipboard contents (newsite@[mydomain].com) into this field
4b. UNcheck "Automatically test account settings...."
4c. Click on MORE SETTINGS
4d. In the INTERNET EMAIL SETTINGS dialog box, on the GENERAL tab, paste the clipboard contents (newsite@[mydomain].com) into the MAIL ACCOUNT field and into the REPLY EMAIL field.
4e. Close all dialog boxes by clicking OK or NEXT or FINISH or CLOSE (as appropriate).

At this point, when I compose a new message, I can click on the FROM button in the new email and select the account newsite@[mydomain].com (which obviously is just custom@[mydomain].com masquerading as newsite@[mydomain].com). The recipient will see this email as coming from newsite@[mydomain].com, and the recipient's reply will go to newsite@[mydomain].com where it will be captured in my wildcard/catchall account.

Can you suggest the VBA code that makes the changes to the Outlook email account settings that I am doing manually (or more precisely, by invoking mini mouse macro) today?

Thank you.
 
Similar threads
Thread starter Title Forum Replies Date
S Example VBA Macro - To Conditionally Change the From Account and Add a BCC Address on Emails Outlook VBA and Custom Forms 11
N Help creating a VBA macro with conditional formatting to change the font color of all external emails to red Outlook VBA and Custom Forms 5
Phillip Macro to Change View on All Folders Using Outlook 4
L Change Category in a Task via macro Using Outlook 8
C Macro to change folder of rules automatically Outlook VBA and Custom Forms 7
J Change Subject of 500 mails sitting in Outbox with Macro Using Outlook 6
B Macro to Change sort and collapse groups in Mail folder Outlook VBA and Custom Forms 9
X Custom icon (not from Office 365) for a macro in Outlook Outlook VBA and Custom Forms 1
X Run macro automatically when a mail appears in the sent folder Using Outlook 5
mrrobski68 Issue with Find messages in a conversation macro Outlook VBA and Custom Forms 1
G Creating Macro to scrape emails from calendar invite body Outlook VBA and Custom Forms 6
J Macro to Reply to Emails w/ Template Outlook VBA and Custom Forms 3
C Outlook - Macro to block senders domain - Macro Fix Outlook VBA and Custom Forms 1
Witzker Outlook 2019 Macro to seach in all contact Folders for marked Email Adress Outlook VBA and Custom Forms 1
S macro error 4605 Outlook VBA and Custom Forms 0
A Macro Mail Alert Using Outlook 4
J Outlook 365 Outlook Macro to Sort emails by column "Received" to view the latest email received Outlook VBA and Custom Forms 0
J Macro to send email as alias Outlook VBA and Custom Forms 0
M Outlook Macro to save as Email with a file name format : Date_Timestamp_Sender initial_Email subject Outlook VBA and Custom Forms 0
Witzker Outlook 2019 Macro GoTo user defined search folder Outlook VBA and Custom Forms 6
D Outlook 2016 Creating an outlook Macro to select and approve Outlook VBA and Custom Forms 0
Witzker Outlook 2019 Macro to send an Email Template from User Defined Contact Form Outlook VBA and Custom Forms 0
Witzker Outlook 2019 Macro to check Cursor & Focus position Outlook VBA and Custom Forms 8
V Macro to mark email with a Category Outlook VBA and Custom Forms 4
M Outlook 2019 Macro not working Outlook VBA and Custom Forms 0
S Outlook 365 Help me create a Macro to make some received emails into tasks? Outlook VBA and Custom Forms 1
Geldner Send / Receive a particular group via macro or single keypress Using Outlook 1
D Auto Remove [EXTERNAL] from subject - Issue with Macro Using Outlook 21
V Macro to count flagged messages? Using Outlook 2
sophievldn Looking for a macro that moves completed items from subfolders to other subfolder Outlook VBA and Custom Forms 7
S Outlook Macro for [Date][Subject] Using Outlook 1
E Outlook - Macro - send list of Tasks which are not finished Outlook VBA and Custom Forms 3
E Macro to block senders domain Outlook VBA and Custom Forms 1
D VBA Macro to Print and Save email to network location Outlook VBA and Custom Forms 1
N VBA Macro To Save Emails Outlook VBA and Custom Forms 1
N Line to move origEmail to subfolder within a reply macro Outlook VBA and Custom Forms 0
Witzker Outlook 2019 Macro to answer a mail with attachments Outlook VBA and Custom Forms 2
A Outlook 2016 Macro to Reply, ReplyAll, or Forward(but with composing new email) Outlook VBA and Custom Forms 0
J Macro to Insert a Calendar Outlook VBA and Custom Forms 8
W Macro to Filter Based on Latest Email Outlook VBA and Custom Forms 6
T Macro to move reply and original message to folder Outlook VBA and Custom Forms 6
D Autosort macro for items in a view Outlook VBA and Custom Forms 2
S HTML to Plain Text Macro - Help Outlook VBA and Custom Forms 1
A Macro to file emails into subfolder based on subject line Outlook VBA and Custom Forms 1
S Visual indicator of a certain property or to show a macro toggle Outlook VBA and Custom Forms 2
L Modifying VBA script to delay running macro Outlook VBA and Custom Forms 3
S Macro to extract and modify links from emails Outlook VBA and Custom Forms 3
M Replyall macro with template and auto insert receptens Outlook VBA and Custom Forms 1
L Macro to add Date & Time etc to "drag to save" e-mails Outlook VBA and Custom Forms 17
S Macro for Loop through outlook unread emails Outlook VBA and Custom Forms 2

Similar threads

Back
Top