A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

populate body with Word data



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 12th 09, 09:47 PM posted to microsoft.public.outlook.program_vba
J. Freed
external usenet poster
 
Posts: 9
Default populate body with Word data

I have an Access DB with a field containing a Word doc as an embedded object.
I think I can retrieve the contents but I can't seem to figure out how to
populate them into the body of the message in VBA. I've seen a few postings
on this subject and I seem to be missing how to actually populate the body.
Any ideas? TIA.....
Ads
  #2  
Old May 12th 09, 11:40 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP][_3_]
external usenet poster
 
Posts: 465
Default populate body with Word data

Once you have your Word.Document object, you can use the technique shown at
http://www.outlookcode.com/codedetail.aspx?id=1333.

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


"J. Freed" wrote in message
news
I have an Access DB with a field containing a Word doc as an embedded
object.
I think I can retrieve the contents but I can't seem to figure out how to
populate them into the body of the message in VBA. I've seen a few
postings
on this subject and I seem to be missing how to actually populate the
body.
Any ideas? TIA.....



  #3  
Old May 14th 09, 10:27 PM posted to microsoft.public.outlook.program_vba
J. Freed
external usenet poster
 
Posts: 9
Default populate body with Word data

It worked. Thanks!

"Sue Mosher [MVP]" wrote:

Once you have your Word.Document object, you can use the technique shown at
http://www.outlookcode.com/codedetail.aspx?id=1333.

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


"J. Freed" wrote in message
news
I have an Access DB with a field containing a Word doc as an embedded
object.
I think I can retrieve the contents but I can't seem to figure out how to
populate them into the body of the message in VBA. I've seen a few
postings
on this subject and I seem to be missing how to actually populate the
body.
Any ideas? TIA.....




  #4  
Old June 12th 09, 04:41 PM posted to microsoft.public.outlook.program_vba
J. Freed
external usenet poster
 
Posts: 9
Default populate body with Word data

This is working well. Now, I need to be able to add data from tables/forms in
addition to the Word data. When I try to add to the body the Word data
disappears, so I'm guessing I need a way to add the data I want to the Word
doc before it gets posted to the note.

TIA.

"J. Freed" wrote:

It worked. Thanks!

"Sue Mosher [MVP]" wrote:

Once you have your Word.Document object, you can use the technique shown at
http://www.outlookcode.com/codedetail.aspx?id=1333.

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


"J. Freed" wrote in message
news
I have an Access DB with a field containing a Word doc as an embedded
object.
I think I can retrieve the contents but I can't seem to figure out how to
populate them into the body of the message in VBA. I've seen a few
postings
on this subject and I seem to be missing how to actually populate the
body.
Any ideas? TIA.....




  #5  
Old June 13th 09, 08:14 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP][_3_]
external usenet poster
 
Posts: 465
Default populate body with Word data

That's probably the best way to do it, to preserve formatting, etc.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"J. Freed" wrote in message
...
This is working well. Now, I need to be able to add data from tables/forms
in
addition to the Word data. When I try to add to the body the Word data
disappears, so I'm guessing I need a way to add the data I want to the
Word
doc before it gets posted to the note.

TIA.

"J. Freed" wrote:

It worked. Thanks!

"Sue Mosher [MVP]" wrote:

Once you have your Word.Document object, you can use the technique
shown at
http://www.outlookcode.com/codedetail.aspx?id=1333.



"J. Freed" wrote in message
news I have an Access DB with a field containing a Word doc as an embedded
object.
I think I can retrieve the contents but I can't seem to figure out
how to
populate them into the body of the message in VBA. I've seen a few
postings
on this subject and I seem to be missing how to actually populate the
body.
Any ideas? TIA.....





  #6  
Old June 15th 09, 09:46 PM posted to microsoft.public.outlook.program_vba
J. Freed
external usenet poster
 
Posts: 9
Default populate body with Word data

I agree. Problem is, I have no idea how to do it. How would I take a field in
a form (or a table) and copy it into the Word doc generated by the code below:

Forms!fcp_new!wire.Verb = 0
Forms!fcp_new!wire.Action = 7
Forms!fcp_new!wire.Object.Application.ActiveDocume nt.Content.Select
Forms!fcp_new!wire.Object.Application.Selection.Ra nge.Copy
Forms!fcp_new!wire.Action = 9
wd.ActiveDocument.SaveAs "L:\Operate1\ELPD_Middle_Office_Reports\OTC
Payments\eos.doc"
Set doc = wd.Documents.Open("L:\Operate1\ELPD_Middle_Office_ Reports\OTC
Payments\eos.doc")
wd.Selection.Range.Paste
wd.ActiveDocument.SaveAs "L:\Operate1\ELPD_Middle_Office_Reports\OTC
Payments\eos.doc"
End If

which takes data from an OLE object in a table and copies it into a Word
doc, which then gets posted to the body using

Set itm = doc.MailEnvelope.Item

TIA......

"Sue Mosher [MVP]" wrote:

That's probably the best way to do it, to preserve formatting, etc.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"J. Freed" wrote in message
...
This is working well. Now, I need to be able to add data from tables/forms
in
addition to the Word data. When I try to add to the body the Word data
disappears, so I'm guessing I need a way to add the data I want to the
Word
doc before it gets posted to the note.

TIA.

"J. Freed" wrote:

It worked. Thanks!

"Sue Mosher [MVP]" wrote:

Once you have your Word.Document object, you can use the technique
shown at
http://www.outlookcode.com/codedetail.aspx?id=1333.



"J. Freed" wrote in message
news I have an Access DB with a field containing a Word doc as an embedded
object.
I think I can retrieve the contents but I can't seem to figure out
how to
populate them into the body of the message in VBA. I've seen a few
postings
on this subject and I seem to be missing how to actually populate the
body.
Any ideas? TIA.....






  #7  
Old June 16th 09, 12:29 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP][_3_]
external usenet poster
 
Posts: 465
Default populate body with Word data

Instead of wd.Selection.Range.Paste, you can use:

wd.Selection.Range.InsertAfter "some text"

or

wd.Selection.Range.InsertAfter some_string_variable_value

Also, the Word macro recorder can be your friend in these situations to show
the useful methods for a given scenario.

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


"J. Freed" wrote in message
...
I agree. Problem is, I have no idea how to do it. How would I take a field
in
a form (or a table) and copy it into the Word doc generated by the code
below:

Forms!fcp_new!wire.Verb = 0
Forms!fcp_new!wire.Action = 7
Forms!fcp_new!wire.Object.Application.ActiveDocume nt.Content.Select
Forms!fcp_new!wire.Object.Application.Selection.Ra nge.Copy
Forms!fcp_new!wire.Action = 9
wd.ActiveDocument.SaveAs "L:\Operate1\ELPD_Middle_Office_Reports\OTC
Payments\eos.doc"
Set doc = wd.Documents.Open("L:\Operate1\ELPD_Middle_Office_ Reports\OTC
Payments\eos.doc")
wd.Selection.Range.Paste
wd.ActiveDocument.SaveAs "L:\Operate1\ELPD_Middle_Office_Reports\OTC
Payments\eos.doc"
End If

which takes data from an OLE object in a table and copies it into a Word
doc, which then gets posted to the body using

Set itm = doc.MailEnvelope.Item

TIA......

"Sue Mosher [MVP]" wrote:

That's probably the best way to do it, to preserve formatting, etc.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"J. Freed" wrote in message
...
This is working well. Now, I need to be able to add data from
tables/forms
in
addition to the Word data. When I try to add to the body the Word data
disappears, so I'm guessing I need a way to add the data I want to the
Word
doc before it gets posted to the note.

TIA.

"J. Freed" wrote:

It worked. Thanks!

"Sue Mosher [MVP]" wrote:

Once you have your Word.Document object, you can use the technique
shown at
http://www.outlookcode.com/codedetail.aspx?id=1333.



"J. Freed" wrote in message
news I have an Access DB with a field containing a Word doc as an
embedded
object.
I think I can retrieve the contents but I can't seem to figure out
how to
populate them into the body of the message in VBA. I've seen a few
postings
on this subject and I seem to be missing how to actually populate
the
body.
Any ideas? TIA.....








  #8  
Old June 16th 09, 04:16 PM posted to microsoft.public.outlook.program_vba
J. Freed
external usenet poster
 
Posts: 9
Default populate body with Word data

That did the trick. Thanks again!

"Sue Mosher [MVP]" wrote:

Instead of wd.Selection.Range.Paste, you can use:

wd.Selection.Range.InsertAfter "some text"

or

wd.Selection.Range.InsertAfter some_string_variable_value

Also, the Word macro recorder can be your friend in these situations to show
the useful methods for a given scenario.

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


"J. Freed" wrote in message
...
I agree. Problem is, I have no idea how to do it. How would I take a field
in
a form (or a table) and copy it into the Word doc generated by the code
below:

Forms!fcp_new!wire.Verb = 0
Forms!fcp_new!wire.Action = 7
Forms!fcp_new!wire.Object.Application.ActiveDocume nt.Content.Select
Forms!fcp_new!wire.Object.Application.Selection.Ra nge.Copy
Forms!fcp_new!wire.Action = 9
wd.ActiveDocument.SaveAs "L:\Operate1\ELPD_Middle_Office_Reports\OTC
Payments\eos.doc"
Set doc = wd.Documents.Open("L:\Operate1\ELPD_Middle_Office_ Reports\OTC
Payments\eos.doc")
wd.Selection.Range.Paste
wd.ActiveDocument.SaveAs "L:\Operate1\ELPD_Middle_Office_Reports\OTC
Payments\eos.doc"
End If

which takes data from an OLE object in a table and copies it into a Word
doc, which then gets posted to the body using

Set itm = doc.MailEnvelope.Item

TIA......

"Sue Mosher [MVP]" wrote:

That's probably the best way to do it, to preserve formatting, etc.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"J. Freed" wrote in message
...
This is working well. Now, I need to be able to add data from
tables/forms
in
addition to the Word data. When I try to add to the body the Word data
disappears, so I'm guessing I need a way to add the data I want to the
Word
doc before it gets posted to the note.

TIA.

"J. Freed" wrote:

It worked. Thanks!

"Sue Mosher [MVP]" wrote:

Once you have your Word.Document object, you can use the technique
shown at
http://www.outlookcode.com/codedetail.aspx?id=1333.


"J. Freed" wrote in message
news I have an Access DB with a field containing a Word doc as an
embedded
object.
I think I can retrieve the contents but I can't seem to figure out
how to
populate them into the body of the message in VBA. I've seen a few
postings
on this subject and I seem to be missing how to actually populate
the
body.
Any ideas? TIA.....









 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Possible to populate a field with same data across multiple contac Arnaud Outlook - Using Contacts 1 February 19th 09 01:15 PM
Populate Access Table with Email Data & Save attchment as pdf or t Gavski Outlook and VBA 1 October 5th 07 06:44 AM
Populate Form with Outlook Contact Data Seagull Ng Outlook - Using Contacts 1 March 1st 06 02:56 PM
Can custom form data populate access database jbtempe Outlook - Using Forms 1 January 20th 06 04:02 PM


All times are GMT +1. The time now is 08:27 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.