Open Adobe

M

Margaret Upton

Does anyone know the code to open a selected file in Adobe please. We have
a template in Adobe that would be so much easier if I can open it with a
macro, but it will not let me record the macro by simply right clicking the
file and choosing open in Adobe, so I would be grateful if someone could
help please. I am using Word 2003 in Windows Vista.

Margaret
 
J

Jay Freedman

If the request is to open the PDF in Acrobat Reader rather than in Word, you
can use something like this:

Sub OpenPDF()
Const qot = """"
Dim progname As String, filename As String

progname = "C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe"
filename = "E:\Docs\somepath\somefile.pdf"

Shell qot & progname & qot & " " & qot & filename & qot, vbNormalFocus
End Sub

The Shell statement launches the program and passes the path to the file
that it should open. The quotes are needed in case there are spaces in
either path.

The Acrobat Reader path may need adjustment because Adobe changes the folder
name with each release.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
M

Margaret Upton

Thank you Jay, I did reply yesterday, but it did not appear on the list,
don't know what happened. I have not tried the code yet, have not had time.
Please can I get back to you if I have any problems. Thank you for your
help, it is most appreciated.

Margaret
 
M

Margaret Upton

Jay thank you so much, it works very well. It is very slow opening, but it
does open and opens the correct template. Much easier to have a button on
the top, than finding the file in amongst that very full folder. Thank you
as always for your help.

Margaret
 

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