![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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 ![]() 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
|
|||
|
|||
![]()
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 ![]() 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
|
|||
|
|||
![]()
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 ![]() 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
|
|||
|
|||
![]()
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 ![]() 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 |
Display Modes | |
|
|
![]() |
||||
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 |