Outlook From Field Macro

K

Karliki

Hello,

I am trying to create a macro that will automatically populate the 'From'
field in an outlook email.

I send a lot of email to different departments and use oft. templates.
However, as I want the replies to go to the group inbox and not I personal
one I am finding that I have to manaually add the group email address into
every email I send.

I have a very limited knowledge of Macro's (especially using them with
Outlook) so any help would be greatly appreciated.
 
S

Sue Mosher [MVP]

For the message that's currently open:

Application.ActiveInspector.CurrentItem.SentOnBehalfOfName = "unique
name or address of mailbox"
 
K

Karliki

Thanks for the reply Sue,

When I try to run the Macro I am getting a 'Run-time '91' error: Object
variable or With block variable not set' any idea what this means?

I have the macro set out as

Sub Address()
Application.ActiveInspector.CurrentItem.From = "Email Address Here"
End Sub

Obviously I have the email address I want to go in the From Field in the
quotation marks.

Thanks for any continuing support.
 
S

Sue Mosher [MVP]

Do you have an item open? If not, there's no ActiveInspector.

Why are you using From, a property that doesn't exist on MailItem objects,
rather than the SentOnBehalfOfName property?

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
 
K

Karliki

Sue,

Thanks for your help I managed this morning to get it working. The confusion
was due to my general ignorance in the field of Macro creation. Thanks again
for your help.
 

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