By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,264 Members | 1,100 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,264 IT Pros & Developers. It's quick & easy.

Shell command for Adobe 7

P: n/a
HI,

I've been trolling through the archives of this list in order to better
understand how to get Access to open Adobe Acrobat and a specific pdf
file. Having never done this before, I've got a tad confused and am
not sure if this code is for A97 or will work with A02. Anyway, I'm
trying to use this code for a command button to open up a specific pdf
file on our intranet. It keeps on getting hung on the Shell line.
Another time it got hung on the fact the path to Adobe was wrong.

Any advice and suggestions are welcome.

Stinky Pete ;-)

Private Sub Full_pdf_form_Click()

Me.axcAcrobat.src = Me![Full pdf form]

Dim strFilePath As String
Dim strAcrobatPath As String

'set the file path for acrobat
strAcrobatPath = "C:\Program
Files\Adobe\Acrobat_7.0\Reader\AcroRd32.exe"
'set the file path for the pdf file (as shown in the textbox name)
strFilePath = "Me.[NCF form pdf].Value"

'open the pdf file
Shell (strAcrobatPath & " " & strFilePath)

End Sub

Aug 30 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Hi stinky Pete
>Stinky Pete ;-)
Have you tried application.followhyperlink
>
Private Sub Full_pdf_form_Click()
Dim strFilePath As String
strFilePath = "\\Path to .pdf"
Application.FollowHyperlink StrFilePath
>
End Sub
Regan

--
Message posted via http://www.accessmonster.com

Aug 30 '06 #2

P: n/a
Hi Regan,

No, I have not tried it as I did not even know it existed ;-) I'll
give it a go and for what may be a silly question, do I need to make
the actual file path in the text box a hyperlink or does this function
"force" the file path to be one anyway? As I metnioned in my original
post, this is new ground for me. Thanx for the suggestion.

Stinky Pete ;-)

Regan via AccessMonster.com wrote:
Hi stinky Pete
Stinky Pete ;-)

Have you tried application.followhyperlink

Private Sub Full_pdf_form_Click()
Dim strFilePath As String
strFilePath = "\\Path to .pdf"
Application.FollowHyperlink StrFilePath

End Sub

Regan

--
Message posted via http://www.accessmonster.com
Aug 30 '06 #3

P: n/a
Hi Regan,

No, I have not tried it as I did not even know it existed ;-) I'll
give it a go and for what may be a silly question, do I need to make
the actual file path in the text box a hyperlink or does this function
"force" the file path to be one anyway? As I metnioned in my original
post, this is new ground for me. Thanx for the suggestion.

Stinky Pete ;-)

Regan via AccessMonster.com wrote:
Hi stinky Pete
Stinky Pete ;-)

Have you tried application.followhyperlink

Private Sub Full_pdf_form_Click()
Dim strFilePath As String
strFilePath = "\\Path to .pdf"
Application.FollowHyperlink StrFilePath

End Sub

Regan

--
Message posted via http://www.accessmonster.com
Aug 30 '06 #4

P: n/a
Hi
>No, I have not tried it as I did not even know it existed ;-) I'll
give it a go and for what may be a silly question, do I need to make
the actual file path in the text box a hyperlink or does this function
"force" the file path to be one anyway? As I metnioned in my original
post, this is new ground for me. Thanx for the suggestion.
No you don't have to make the file path a hyperlink

Sweet As Alkatraz
>Regan
--
Message posted via http://www.accessmonster.com

Aug 30 '06 #5

P: n/a
Hey,

Well at least now I can open adobe ;-) I'll keep playing to see what
else I can learn. I know I am close ;-)

Stinky Pete ;-)

Regan via AccessMonster.com wrote:
Hi
No, I have not tried it as I did not even know it existed ;-) I'll
give it a go and for what may be a silly question, do I need to make
the actual file path in the text box a hyperlink or does this function
"force" the file path to be one anyway? As I metnioned in my original
post, this is new ground for me. Thanx for the suggestion.

No you don't have to make the file path a hyperlink

Sweet As Alkatraz
Regan

--
Message posted via http://www.accessmonster.com
Aug 30 '06 #6

P: n/a
Stinky Pete wrote:
>Hey,

Well at least now I can open adobe ;-) I'll keep playing to see what
else I can learn. I know I am close ;-)
Here is an example. it might be clearer

Text box containtion path to * pdf
Textbox = \\computername\wherefileis\Mypdf File.pdf <--text fields
Textbox = C:\mydocuments\MyPdfFileIWantToOpen.pdf
Dim strfile As String

strfile = me!textbox

Application.followhyperlink strfile
This can also be used to open *.doc and *.xls and MORE

regan

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200608/1

Aug 30 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.