VBA code to select a signature from the signatures list

Dr. Bartolo

Member
Outlook version
Outlook 2016 32 bit
Email Account
POP3
My administrator at work runs a process three or four times a day which deletes my custom signature from the list of signatures I can use in Outlook. I have Outlook VBA code which extracts from a zip file my own signtaure block (it looks identical to the default but has formatting attributes I need for other macros to run on it) and adds it back to the list of available signatures, but I then need to manually select my signature as the one to use when answering emails and creating new ones. Does anyone have any idea how I could code to select my newly recreated signature block to create new emails answer emails instead of doing this manually each time?
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
The default signature is set in the registry... do you have edit permissions on the registry? If so, a reg file can set the default and can be set using VBA.

Not knowing what happens when he deletes it... could you replace the default sig files with your sig files?

That said, I would consider one of two options - a macro to insert the signature or stationery with the signature added. Inserting your signature can be automated for new mail and replies but stationary is new mail only.

This macro inserts a signature....

Another thought (just a thought, might not be workable depending on the coding,)... read the HTML and replace the default signature attributes with the ones you need. This macro can give you the basic idea of how to do it...
 

Dr. Bartolo

Member
Outlook version
Outlook 2016 32 bit
Email Account
POP3
I have looked at these and similar approaches, but unfortunately they do not work for me for a number of reasons.

I do not have registry edit permissions, which is a pity in this context.

I might be able to replace the default signature files with my own files, but I am reluctant to do that. I do just want to add my own files, which I am allowed to do, not play with what the administrator has done, which I am not allowed to do. I suspect that unless I delete/amend the administrator's signature files I would get two sets of signatures which I definmitely do not want!

My signature block includes images as well as text, which I suspect makes the issue that much more difficult.

If this were Word I would just record in a macro the steps that I take to select my signature files as the default for new messages and for replying to messages from the File → Options → Mail → Signatures dropdown area, and copy that code. That is all that I want to do!
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
You would need to use send keys AFAIK - setting the default signature is a not an
object model option.

The first method should work since it reads your sig file and replaces the text in the body.


My signature block includes images as well as text, which I suspect makes the issue that much more difficult.

If it is wildly different from the one they want you to use, it is more difficult. Post (or attach text files) of the two signatures - replace identifying data with 'companyname' 'phone' 'emailaddress' etc (without the quotes) and I'll take a look.
 
Similar threads
Thread starter Title Forum Replies Date
S Excel vba code to manage outlook web app Using Outlook 10
S Outlook VBA How to adapt this code for using in a different Mail Inbox Outlook VBA and Custom Forms 0
S Add VBA save code Using Outlook 0
C Auto Run VBA Code on new email Outlook VBA and Custom Forms 1
F VBA code to dock Styles whenever I write or edit an email Outlook VBA and Custom Forms 0
S Skype for business meeting vba code Outlook VBA and Custom Forms 1
R Expand VBA Permanent Delete Code Outlook VBA and Custom Forms 6
B Outlook Business Contact Manager with SQL to Excel, User Defined Fields in BCM don't sync in SQL. Can I use VBA code to copy 1 field to another? BCM (Business Contact Manager) 0
A VBA Code in Outlook disappears after first use Outlook VBA and Custom Forms 1
F VBA to ensure a code is entered in Subject title Outlook VBA and Custom Forms 1
N Open & Save VBAProject.Otm using VBA Code Outlook VBA and Custom Forms 1
R VBA Code to permanently delete selected email Outlook VBA and Custom Forms 10
C Need VBA code to automatically save message outside outlook and add date Outlook VBA and Custom Forms 1
S VBA Code to move mail items from search folder to inbox subfolder Outlook VBA and Custom Forms 4
B VBA Code to create appointment from email Outlook VBA and Custom Forms 1
D VBA Code to strip Subject Line when replying or forwarding Using Outlook 3
M VBA Code to Restart Outlook on error Outlook VBA and Custom Forms 3
Z Default VBA code for extracting data from email (Outlook) to Excel? Outlook VBA and Custom Forms 1
T VBA to Sort Rules [A-Z] - code provided Outlook VBA and Custom Forms 9
M VBA Auto-Reply code for Two Mailboxes on one Outlook Session. Outlook VBA and Custom Forms 4
Z Protecting VBA code - anything new? Outlook VBA and Custom Forms 2
G VBA code to enable a rule based on time of day for a IMAP mail account Outlook VBA and Custom Forms 14
S VBA code to rename a task (flagged message) Outlook VBA and Custom Forms 1
M VBA code to save email attachments (PDF) as email subject line Outlook VBA and Custom Forms 1
F VBA Code to change subject Like Outlook VBA and Custom Forms 3
Diane Poremsky Pasting VBA code (and other editing) Outlook VBA and Custom Forms 4
C Required VBA code to complete task when replied to Outlook VBA and Custom Forms 2
Kelli VBA code for Outlook Using Outlook 1
S Requried a VBA Code to export Calander details to excel... Outlook VBA and Custom Forms 4
M VBA Code to extract data from an Outlook Form Using Outlook 0
M VBA code needed to move from Outlook 2010 subfolder to Symantec Vault subfolde Using Outlook 0
C In need of VBA code to read / parse HTML - Outlook emails Using Outlook 0
R [VBA] complicated(?) outlook events - need help with code Using Outlook 15
R how to get Outlook VBA code to work on the current folder Using Outlook 3
J VBA code can't be completely executed in outlook 2013 Using Outlook 0
D VBA: Send-From Code for Template Shortcut? Using Outlook 0
P VBA Code being completely ignored by Outlook Using Outlook 7
M Updating VBA code from outlook 2007 to outlook 2010 Using Outlook 1
J VBA code to determine 'show' state of SearchBar Using Outlook 7
D VBA code running on Server? Shared mailbox email routing Using Outlook 3
L Send E-mail with VBA code from [E-mail Distribution Group] if I have “Send as” Using Outlook 6
S Outllok 2007 VBA code to send mail automatically from drafts folder Using Outlook 1
S ThisOutlookSession in VBA not there anymore and code is gone Using Outlook 2
F No Attachment Warning - VBA Code HELP Outlook VBA and Custom Forms 1
J VBA code (rules) won't work after reboot Outlook VBA and Custom Forms 2
N VBA code to show today's date + a sequencial number in subject lin Outlook VBA and Custom Forms 1
A Accessing .pst folder in outlook using VBA Code Outlook VBA and Custom Forms 4
C Beginner Needs VBA Help in Modifying Code Outlook VBA and Custom Forms 2
P 'Trusted' VBA code in Outlook 2003? Outlook VBA and Custom Forms 2
F Recovery of VBA code Outlook VBA and Custom Forms 2

Similar threads

Top