Include contents of other files in reports

R

rwilliams616

I have a subform in which I allow the user to enter a hyperlink to other
files (MS Word or PDF documents). So obviously when a user clicks on the
hyperlink, the file will open. Right now I have it set up so that my report
simply shows the hyperlink location. What I would like to know is if I can
include the contents of those linked files in my report? So for example, I
would like the word or PDF file to print within the Access report. Can
anyone tell me if this is possible? Thanks.
 
S

smoknjo

sorry then, I can't help you. I just ran into the same thing, however,
version 2007 has an option for "attachments" that you can view, add, delete
from a report, form ..etc..

good luck!
 
F

fredg

I have a subform in which I allow the user to enter a hyperlink to other
files (MS Word or PDF documents). So obviously when a user clicks on the
hyperlink, the file will open. Right now I have it set up so that my report
simply shows the hyperlink location. What I would like to know is if I can
include the contents of those linked files in my report? So for example, I
would like the word or PDF file to print within the Access report. Can
anyone tell me if this is possible? Thanks.

This was the answer to a similar question (just last week I think)
that I got from one of the newsgroups.
Place the following code in a module. Then you can call it from your
report and it will print in addition to the Access report you are
running.
Note: You must have a reference set to the Microsoft Word 10 library.

Store the path and document name, not as a hyperlink but as normal
text.... "c:\MyPath\DocName.doc" in a table field.

Sub PrintWordDoc(StrIn As String)

' Open and print a Word document from Access
' Must have a reference to the Microsoft Word 10.0 Library set
On Error Resume Next
Dim objWord As Object
Dim objDoc As Object
Const wdPrintAllDocument = 0

Set objWord = CreateObject("Word.Application")
objWord.Visible = False

Set objDoc = objWord.Documents.Open(StrIn)
objWord.ActiveDocument.PrintOut , _
Background:=False, _
Range:=wdPrintAllDocument
objDoc.Close False
Set objDoc = Nothing
objWord.Quit
Set objWord = Nothing

End Sub
______________

I called it from the Report's Close event:

PrintWordDoc(FieldName)

It will print the report, then the document.
You may need to move the code to a different event, depending upon how
your report is set up.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top