populate subject

  • Thread starter Thread starter Joel Allen
  • Start date Start date
J

Joel Allen

Hello,

I have a word template file that is set up for e-mail. I try this code:

objDoc.Application.Mailer.Subject = "Email Subject"

and it says that it doesn't support the object. It doesn't recognize
Mailer.Subject .

Any thoughts?

Thanks,
Joel
 
Mailer is an object in Word for Macintosh, not for PCs.

Maybe you could back up and provide a little more context on what you're trying to do.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Ok sure.

Within my custom form, I press a button that runs a script that opens a word
template. The word template has the e-mail option already on. ([File],
[Send To],[Mail Receipient]) My template has bookmarks which are
autopopulated from fields from my custom form. Everything works great, but
I also want to autopopulate the Subject field in the word template, but you
can't put a bookmark in the subject field.

I hope that makes sense. Thanks for your help,
Joel

Mailer is an object in Word for Macintosh, not for PCs.

Maybe you could back up and provide a little more context on what you're
trying to do.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Ah, then you're just using the wrong objects. What you want is Document.MailEnvelope.Item. The Item object property gives you access to the Outlook MailItem, thus:

objDoc.MailEnvelope.Item.Subject = "Email Subject"

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Joel Allen said:
Ok sure.

Within my custom form, I press a button that runs a script that opens a word
template. The word template has the e-mail option already on. ([File],
[Send To],[Mail Receipient]) My template has bookmarks which are
autopopulated from fields from my custom form. Everything works great, but
I also want to autopopulate the Subject field in the word template, but you
can't put a bookmark in the subject field.
Hello,

I have a word template file that is set up for e-mail. I try this code:

objDoc.Application.Mailer.Subject = "Email Subject"

and it says that it doesn't support the object. It doesn't recognize
Mailer.Subject .

Any thoughts?

Thanks,
Joel
 
Thank God for you Sue, it worked! I'm really trying to learn here - I
looked in the object browser prior to this, and MailEnvelope did not exist.
How could I have found it? Was I looking in the wrong place?

-Joel

Ah, then you're just using the wrong objects. What you want is
Document.MailEnvelope.Item. The Item object property gives you access to the
Outlook MailItem, thus:

objDoc.MailEnvelope.Item.Subject = "Email Subject"

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Joel Allen said:
Ok sure.

Within my custom form, I press a button that runs a script that opens a
word
template. The word template has the e-mail option already on. ([File],
[Send To],[Mail Receipient]) My template has bookmarks which are
autopopulated from fields from my custom form. Everything works great,
but
I also want to autopopulate the Subject field in the word template, but
you
can't put a bookmark in the subject field.
Hello,

I have a word template file that is set up for e-mail. I try this code:

objDoc.Application.Mailer.Subject = "Email Subject"

and it says that it doesn't support the object. It doesn't recognize
Mailer.Subject .

Any thoughts?

Thanks,
Joel
 
You would have found it if you'd searched the object browser for either "mail" or "envelope." Sometimes it just takes a little trial and error to figure out how to use things.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Joel Allen said:
Thank God for you Sue, it worked! I'm really trying to learn here - I
looked in the object browser prior to this, and MailEnvelope did not exist.
How could I have found it? Was I looking in the wrong place?

-Joel

Ah, then you're just using the wrong objects. What you want is
Document.MailEnvelope.Item. The Item object property gives you access to the
Outlook MailItem, thus:

objDoc.MailEnvelope.Item.Subject = "Email Subject"

Joel Allen said:
Ok sure.

Within my custom form, I press a button that runs a script that opens a
word
template. The word template has the e-mail option already on. ([File],
[Send To],[Mail Receipient]) My template has bookmarks which are
autopopulated from fields from my custom form. Everything works great,
but
I also want to autopopulate the Subject field in the word template, but
you
can't put a bookmark in the subject field.
Hello,

I have a word template file that is set up for e-mail. I try this code:

objDoc.Application.Mailer.Subject = "Email Subject"

and it says that it doesn't support the object. It doesn't recognize
Mailer.Subject .

Any thoughts?

Thanks,
Joel
 
Back
Top