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!

Access 2003 / Acrobat 7 - opening PDF file

Status
Not open for further replies.

Blackshark

Programmer
May 7, 2002
48
GB
First of all - apologies if I have missed somethign obvious or mentioned in other posts. I have spent most of the afternoon trying to get this to work - with limited success.


I am trying to open Acrobat (full - executable) and open a PDF file - using VBA from Access. I cant use hyperlinks etc... - in the environment I am restricted to - this does not work.


Dim app_Acrobat As Acrobat.CAcroApp
Dim doc_Acrobat As Acrobat.CAcroPDDoc

Dim var_return As Variant

Set app_Acrobat = CreateObject("AcroExch.App")
app_Acrobat.Show
Set doc_Acrobat = CreateObject("AcroExch.PDDoc")
doc_Acrobat.Open "C:\test.pdf"
doc_Acrobat.OpenAVDoc "C:\test.pdf"


The above code works one time out of two. Use it once, PDF file opens in Acrobat. Close acrobat and try it again - error message and acrobat bombs on me.


I know the above code is not 'right'. If I leave it at just doc_Acrobat.open.... then the PDF file does not actually open in the Acrobat window.


Your helps tek-tipers greatfully recevied.


Regards Tim
 
Just making sure I understand you want to open the file, as in, open the file for viewing thru the application.

Or, open the file for processing?

Mike
 
If you just want to open it do a quick google search on

vba ShellExecute

Mike
 
Mike,

Thanks for the replies. Yes - I need the application opening, file loading. I then - depending on the contents of a data record in Access, carry out various operations (opening up notes, highlighting key words etc....). Thay bit is easy - I just dont know why Acrobat crashes every other time it is opened using the above method.

Regards TIm
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top