Automatically add signature with different mailboxes in the sameexchange server

H

HammerJoe

Hi,

I hope someone can help me.
Im using Outlook 2007 and I have one mail exchange account with
several mailboxes.
Each mailbox has its own signature.
I have created the different signatures and I would like for Outlook
when creating a new email or replying to one to automatically detect
which mailbox it is and add to the email the predefined signature.

How can this be done?
Thanks.
 
H

HammerJoe

Hi,

I hope someone can help me.
Im using Outlook 2007 and I have one mail exchange account with
several mailboxes.
Each mailbox has its own signature.
I have created the different signatures and I would like for Outlook
when creating a new email or replying to one to automatically detect
which mailbox it is and add to the email the predefined signature.

How can this be done?
Thanks.

Could I get some help with this please?
 
M

Michael Bednarek

Could I get some help with this please?

You need to develop a method to return a signature name based on
Activeexplorer.CurrentFolder.FolderPath

Then you need to open the file with the signature, read it and insert it
into the message (which needs a different treatment for HTML messages
and text-only messages); all driven by a event triggers (Reply,
ReplyAll, Forward, NewInspector, <inspector>.Activate and possibly
others).

Alternatively, the task might be simplified with
ActiveInspector.CommandBars("Menu Bar") _
.Controls("Insert") _
.Controls("Signature") _
.Controls(folderspecificAddress).Execute
once you worked out which signature name belongs to which folder. This
method depends of course on the local language and on the presence of
those menu items.
 
H

HammerJoe

Michael,

Thank you for the help.
Unfortunately its not much help for me. Although I know a bit of Vba,
I am not familiar with its integration with Outlook.

Would you be kind to have some kind of working SUB that I could use?
Once I see how it works in Outlook I might be able to figure it out.

Thanks again.
 
M

Michael Bednarek

Michael,

Thank you for the help.
Unfortunately its not much help for me. Although I know a bit of Vba,
I am not familiar with its integration with Outlook.

Would you be kind to have some kind of working SUB that I could use?
Once I see how it works in Outlook I might be able to figure it out.

Thanks again.

The following code works here:

Sub InsertFolderSignature()

Dim strFolder As String

strFolder = ActiveExplorer.CurrentFolder.FolderPath
strFolder = Mid(strFolder, 3, InStr(3, strFolder, "\") - 3)
ActiveInspector.CommandBars("Menu Bar"). _
Controls("Insert"). _
Controls("Signature"). _
Controls(strFolder).Execute
End Sub

The assumption is that there is a signature named exactly as the folder
name; there is no check that this is true nor is there any error
trapping if it isn't. Creating a menu item or a command bar button to
run the macro is left as an exercise for the reader.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top