Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Push To WORD?

Status
Not open for further replies.

iamchemist

Programmer
Mar 2, 2009
73
US
First, let me thank this Forum for tremendous help you have given an Access newbie over the past few years. You have helped me solve many Access problems involved with the non-profit Food Pantry where I volunteer, and I very much appreciate the help.

I currently have a need to get Access to fill our a Government Document/Form (Attached as a WORD document). I would appreciate suggestions as to the best way to do this.

I have read a bit on this Forum about ways to "Push Data To WORD", which sounds like a viable option, but I don't yet understand how do go about it. I have also read here about VBA commands that can be used to get an Access Report to place data in specific locations on a page, which might well be another viable option to get Access to fill out this Government Document.

Would one of these or yet another option be the best way to go here? Are there references that you could point me to to learn how to accomplish this?
 
 https://files.engineering.com/getfile.aspx?folder=76ce26ee-e575-4723-9bff-05db8d8d2531&file=TEFAP_Form.docx
Since the document is mostly data, I would create an Access report with subreports. You could also set some bookmarks in the Word document and use Word automation to place data into the bookmarks

Duane
Minnesota
Hook'D on Access
MS Access MVP 2001-2016
 
Hi Duane,

Thanks for the reply.

I have found a video by Steve Bishop that goes into the "Bookmark" process to push data to a WORD Document. So, that seems to be quite helpful, too.

Thanks again,

Ron
 
The project for which I needed to "Push" Access Data to Word is now gone. But in my research I did learn how to do it, and it might be of some use to you.

Word MVP Cindy Meister posted the VBA Code below, which did work for me:

Dim oWord as Object
Dim oDoc as Object
Set oWord = CreateObject("Word.Application")
oWord.Visible = True
Set oDoc = oWord.Documents.Open("PathTo.doc")
oDoc.Bookmarks("NameOfBookmark").Range.Text = "Some text"
Set oDoc = Nothing
Set oWord = Nothing

Of course, this code would need to be combined with some looping and recordset move commands to do much good, but it's a good start.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top