msoutlook.org Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Program data into the "To, Cc and Introduction" fields

 
Post new topic   Reply to topic    msoutlook.org Forum Index -> Outlook Program VBA
Author Message
smar



Joined: 30 Jan 2008
Posts: 2

PostPosted: Wed Jan 30, 2008 12:36 am    Post subject: Program data into the "To, Cc and Introduction" fields Reply with quote

I am in MS Word 2003 and I select the E-Mail icon on the Toolbar. It brings
up the
Outlook 2003 "To:..., Cc..., Subject: and Introduction:" fields at the top
of the Word document, along with some of the Outlook toolbar icons.

I want add some code a MS Word macro to insert email addresses into the To:
and Cc: fields, instead of typing them in over and over. I would some
appreciate sample code. I tried using the MS Word group with no luck, so I
am trying the Outlook group

Archived from group: microsoft>public>outlook>program_vba
Back to top
View user's profile Send private message
Michael Bauer [MVP - Outl



Joined: 12 Aug 2007
Posts: 92

PostPosted: Wed Jan 30, 2008 11:53 am    Post subject: Re: Program data into the "To, Cc and Introduction" fields Reply with quote

You can use this sample for Outlook, not word:
http://www.vboffice.net/sample.html?mnu=2&pub=6&lang=en&smp=47&cmd=showitem

--
Best regards
Michael Bauer - MVP Outlook
Synchronize Outlook Categories:


Am Tue, 29 Jan 2008 19:36:00 -0800 schrieb smar:

> I am in MS Word 2003 and I select the E-Mail icon on the Toolbar. It
brings
> up the
> Outlook 2003 "To:..., Cc..., Subject: and Introduction:" fields at the top
> of the Word document, along with some of the Outlook toolbar icons.
>
> I want add some code a MS Word macro to insert email addresses into the
To:
> and Cc: fields, instead of typing them in over and over. I would some
> appreciate sample code. I tried using the MS Word group with no luck, so
I
> am trying the Outlook group
Back to top
View user's profile Send private message
Sue Mosher [MVP-Outlook]



Joined: 12 Aug 2007
Posts: 656

PostPosted: Wed Jan 30, 2008 4:28 pm    Post subject: Re: Program data into the "To, Cc and Introduction" fields Reply with quote

Try this Word macro:

Sub AddInfoToMsg()
Dim env As Office.MsoEnvelope
Set env = ActiveDocument.MailEnvelope
With env
.Introduction = "My introduction"
.Item.To = "recip1@domain.dom"
.Item.cc = "recip2@domain.dom"
End With
Set env = Nothing
End Sub

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


"smar" wrote in message @microsoft.com...
>I am in MS Word 2003 and I select the E-Mail icon on the Toolbar. It brings
> up the
> Outlook 2003 "To:..., Cc..., Subject: and Introduction:" fields at the top
> of the Word document, along with some of the Outlook toolbar icons.
>
> I want add some code a MS Word macro to insert email addresses into the To:
> and Cc: fields, instead of typing them in over and over. I would some
> appreciate sample code. I tried using the MS Word group with no luck, so I
> am trying the Outlook group
Back to top
View user's profile Send private message
smar



Joined: 30 Jan 2008
Posts: 2

PostPosted: Wed Jan 30, 2008 3:01 pm    Post subject: Re: Program data into the "To, Cc and Introduction" fields Reply with quote

Many thanks for the program code, it worked GREAT...

"Sue Mosher [MVP-Outlook]" wrote:

> Try this Word macro:
>
> Sub AddInfoToMsg()
> Dim env As Office.MsoEnvelope
> Set env = ActiveDocument.MailEnvelope
> With env
> .Introduction = "My introduction"
> .Item.To = "recip1@domain.dom"
> .Item.cc = "recip2@domain.dom"
> End With
> Set env = Nothing
> End Sub
>
> --
> Sue Mosher, Outlook MVP
> Author of Microsoft Outlook 2007 Programming:
> Jumpstart for Power Users and Administrators
> http://www.outlookcode.com/article.aspx?id=54
>
>
> "smar" wrote in message @microsoft.com...
> >I am in MS Word 2003 and I select the E-Mail icon on the Toolbar. It brings
> > up the
> > Outlook 2003 "To:..., Cc..., Subject: and Introduction:" fields at the top
> > of the Word document, along with some of the Outlook toolbar icons.
> >
> > I want add some code a MS Word macro to insert email addresses into the To:
> > and Cc: fields, instead of typing them in over and over. I would some
> > appreciate sample code. I tried using the MS Word group with no luck, so I
> > am trying the Outlook group
>

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
printing custom forms with user defined and standard fields Help. I am so proud of myself because I have managed to create a custom form and print it out beautifully by inserting a VSB script and linking it to Word. The only problem is that all of my user-defined fields print correctly .. . but I can't get the T

Writing data on a XML file on internet Hello, I am still a beginner in VBA... I am searching a way to write/modify data in a xml file on internet from a macro in Outlook. I found a way, with and get method, to read some text data in a file, or get the whole file,

Import Outlook Task Form Data Into Access I have several public task folders from which I would like to import the task information into Access including some form data. I've tried the table linking deal but it doesn't include the start date and other form data. I know the EntryIDs and StoreIDs b

How can I export outlook form fields data into an access dat I'm using Outlook 2003. I have created a form in outlook with custom made form This form has 3 different tabs/pages if you will. When the form goes to the end user, I would like to export the data collected into an access database.

which fax program There's a really useful document in the Microsoft knowledge library(?) about which fax program goes with which version of windows or office. Of course now that I need it I can't find it. Can anyone help? Peter
Post new topic   Reply to topic    msoutlook.org Forum Index -> Outlook Program VBA All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group