On Tue, 8 Feb 2011 13:01:35 -0800 (PST), HammerJoe@... wrote in
microsoft.public.outlook.program_vba:
>On Jan 26, 11:34*pm, "Hammer...@gmail.com" <hammer...@gmail.com>
>wrote:
>> 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?
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.
--
Michael Bednarek
http://mbednarek.com/ "POST NO BILLS"