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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word Document in Report

Status
Not open for further replies.

anasazii

Programmer
Jun 19, 2001
59
US
Hello,

Does anyone know how to combine an existing Word Document with an Access Report?


I have a report that I created in Access, and would like to include information that is already entered in a Word document, stored on the network.


I have tried creating both bound & unbound object frames. The unbound works ok, but my problem is that i need to change the name of the report depending on which product is being viewed. I have tried doing this programmatically, but it still shows the original report that I used to created the link.


I have tried to do this programmatically with the bound Object frame, using something like the following:

Me.boundPLI.OLETypeAllowed = acOLELinked
Me.boundPLI.Class = "Word.Document"
Me.boundPLI.SourceDoc = docPath
Me.boundPLI.Action = acOLECreateLink

The code then always errors at the .Action line... i think something to the effect of 'the Action can't be carried out right now'. When I comment out the .Action line, the report opens w/nothing in the Frame.


The closest that I've been able to get is with the following code:

- btnPLI is a button placed on the report
- ctl is dimmed as CommandButton

Set ctl = Me.btnPLI
With ctl
.HyperlinkAddress = docPath
.Hyperlink.Follow
End With

This opens the document in Word, but I would really like to incorporate it into the report. For one reason, I will have to email the report as an attachment, and I do not know how to include both documents.


Any ideas????
Also, could anyone explain to me what exactly the difference is between a Bound Object Frame & an Unbound Object Frame????


Thanks, Janel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top