Opening a file in adobe acrobat format

  • Thread starter Thread starter Frank
  • Start date Start date
F

Frank

Hi
I have a command button on my form which
opens "c:\Adobe/Acrobat 6.0\reader\AcroRd 32.exe" so far
so good, but I want to go further and get it to open the
file saved as per auto number on the form. Do you think
this can be done? In other wards I have supplementary
documents associated with my data base and need to access
them and as pdf files take up the least space that is the
format they have been saved in.

Hope you can help

With thanks

Frank
 
You can open a particular application and file by
providing the file path and name after the command line of
the application. The application command line and
location of file are separated by a space:

"[Drive Letter]:\[application path and exe name][space]
[Drive Letter]:\[file path and name]"
The whole line is enclosed with double quotes. For easire
reading , set up the PDF FileName and Path as variables.
Believe what your looking for is something like this:

Dim strFileName as String, strPDFPath as String
strFileName = Me.[form field name]
strPDFPath = "[Drive Letter]:\[path]"

stAppName = "C:\Program Files\Adobe\Acrobat 6.0
\Reader\AcroRd32.exe " & strPDFPath & strFileName & ".pdf"
Call Shell(stAppName, 1)
 
Virgil
I followed your instructions as best I could but on
pressing command button get "cant find file" message. here
is what I put in
Private Sub PATIENT_COPY_ACCOUNT_Click()
On Error GoTo Err_PATIENT_COPY_ACCOUNT_Click

Dim stAppName As String, strPDFPath As String
strFileName = Me.[Auto Number]
strPDFPath = "[D]:\[Patient Copy Account]"

stAppName = "C:\Program Files\Adobe\Acrobat 6.0
\Reader\AcroRd32.exe" & strPDFPath & strAutoNumber & ".pdf"
Call Shell(stAppName, 1)

Exit_PATIENT_COPY_ACCOUNT_Click:
Exit Sub

Err_PATIENT_COPY_ACCOUNT_Click:
MsgBox Err.Description
Resume Exit_PATIENT_COPY_ACCOUNT_Click

End Sub
is it correct?
My pdf files are saved under the auto number assigned to
the form.

Regards Frank
-----Original Message-----
You can open a particular application and file by
providing the file path and name after the command line of
the application. The application command line and
location of file are separated by a space:

"[Drive Letter]:\[application path and exe name][space]
[Drive Letter]:\[file path and name]"
The whole line is enclosed with double quotes. For easire
reading , set up the PDF FileName and Path as variables.
Believe what your looking for is something like this:

Dim strFileName as String, strPDFPath as String
strFileName = Me.[form field name]
strPDFPath = "[Drive Letter]:\[path]"

stAppName = "C:\Program Files\Adobe\Acrobat 6.0
\Reader\AcroRd32.exe " & strPDFPath & strFileName & ".pdf"
Call Shell(stAppName, 1)
-----Original Message-----
Hi
I have a command button on my form which
opens "c:\Adobe/Acrobat 6.0\reader\AcroRd 32.exe" so far
so good, but I want to go further and get it to open the
file saved as per auto number on the form. Do you think
this can be done? In other wards I have supplementary
documents associated with my data base and need to access
them and as pdf files take up the least space that is the
format they have been saved in.

Hope you can help

With thanks

Frank
.
.
 
You don't have a space between Acrord32.exe and the value of strPDFPath,
which Virgil explicitly mentioned.

strPDFPath should be = "D:\Patient Copy Account", not "[D]:\[Patient Copy
Account]"

Since your file names have blanks in them, you need to enclose them in
quotes.

stAppName = """C:\Program Files\Adobe\Acrobat 6.0\Reader\AcroRd32.exe""
""" & strPDFPath & strAutoNumber & ".pdf"""

or

stAppName = Chr$(34) & "C:\Program Files\Adobe\Acrobat
6.0\Reader\AcroRd32.exe" & Chr$(34) & " " & Chr$(34) & strPDFPath &
strAutoNumber & ".pdf" & Chr$(34)


--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Virgil
I followed your instructions as best I could but on
pressing command button get "cant find file" message. here
is what I put in
Private Sub PATIENT_COPY_ACCOUNT_Click()
On Error GoTo Err_PATIENT_COPY_ACCOUNT_Click

Dim stAppName As String, strPDFPath As String
strFileName = Me.[Auto Number]
strPDFPath = "[D]:\[Patient Copy Account]"

stAppName = "C:\Program Files\Adobe\Acrobat 6.0
\Reader\AcroRd32.exe" & strPDFPath & strAutoNumber & ".pdf"
Call Shell(stAppName, 1)

Exit_PATIENT_COPY_ACCOUNT_Click:
Exit Sub

Err_PATIENT_COPY_ACCOUNT_Click:
MsgBox Err.Description
Resume Exit_PATIENT_COPY_ACCOUNT_Click

End Sub
is it correct?
My pdf files are saved under the auto number assigned to
the form.

Regards Frank
-----Original Message-----
You can open a particular application and file by
providing the file path and name after the command line of
the application. The application command line and
location of file are separated by a space:

"[Drive Letter]:\[application path and exe name][space]
[Drive Letter]:\[file path and name]"
The whole line is enclosed with double quotes. For easire
reading , set up the PDF FileName and Path as variables.
Believe what your looking for is something like this:

Dim strFileName as String, strPDFPath as String
strFileName = Me.[form field name]
strPDFPath = "[Drive Letter]:\[path]"

stAppName = "C:\Program Files\Adobe\Acrobat 6.0
\Reader\AcroRd32.exe " & strPDFPath & strFileName & ".pdf"
Call Shell(stAppName, 1)
-----Original Message-----
Hi
I have a command button on my form which
opens "c:\Adobe/Acrobat 6.0\reader\AcroRd 32.exe" so far
so good, but I want to go further and get it to open the
file saved as per auto number on the form. Do you think
this can be done? In other wards I have supplementary
documents associated with my data base and need to access
them and as pdf files take up the least space that is the
format they have been saved in.

Hope you can help

With thanks

Frank
.
.
 
Doug - Thank you
I have changed as per your advice:
Dim stAppName As String, strPDFPath As String
strFileName = Me.[Auto Number]
strPDFPath = "D:\Patient Copy Account"

stAppName = """C:\Program Files\Adobe\Acrobat 6.0
\Reader\AcroRd32.exe""" & strPDFPath & strFileName
& ".pdf"""
Call Shell(stAppName, 1)

Exit_PATIENT_COPY_ACCOUNT_Click:
Exit Sub

Err_PATIENT_COPY_ACCOUNT_Click:
MsgBox Err.Description
Resume Exit_PATIENT_COPY_ACCOUNT_Click

End Sub
However when activated the Reader opens with an error
message
"There is an error opening this document. The file name,
directory name, or volume lable syntex is incorrect."
Any furthers ideas? Sorry to keep bothering you

With thanks
Frank
-----Original Message-----
You don't have a space between Acrord32.exe and the value of strPDFPath,
which Virgil explicitly mentioned.

strPDFPath should be = "D:\Patient Copy Account", not "[D]:\[Patient Copy
Account]"

Since your file names have blanks in them, you need to enclose them in
quotes.

stAppName = """C:\Program Files\Adobe\Acrobat 6.0 \Reader\AcroRd32.exe""
""" & strPDFPath & strAutoNumber & ".pdf"""

or

stAppName = Chr$(34) & "C:\Program Files\Adobe\Acrobat
6.0\Reader\AcroRd32.exe" & Chr$(34) & " " & Chr$(34) & strPDFPath &
strAutoNumber & ".pdf" & Chr$(34)


--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Virgil
I followed your instructions as best I could but on
pressing command button get "cant find file" message. here
is what I put in
Private Sub PATIENT_COPY_ACCOUNT_Click()
On Error GoTo Err_PATIENT_COPY_ACCOUNT_Click

Dim stAppName As String, strPDFPath As String
strFileName = Me.[Auto Number]
strPDFPath = "[D]:\[Patient Copy Account]"

stAppName = "C:\Program Files\Adobe\Acrobat 6.0
\Reader\AcroRd32.exe" & strPDFPath & strAutoNumber & ".pdf"
Call Shell(stAppName, 1)

Exit_PATIENT_COPY_ACCOUNT_Click:
Exit Sub

Err_PATIENT_COPY_ACCOUNT_Click:
MsgBox Err.Description
Resume Exit_PATIENT_COPY_ACCOUNT_Click

End Sub
is it correct?
My pdf files are saved under the auto number assigned to
the form.

Regards Frank
-----Original Message-----
You can open a particular application and file by
providing the file path and name after the command line of
the application. The application command line and
location of file are separated by a space:

"[Drive Letter]:\[application path and exe name][space]
[Drive Letter]:\[file path and name]"
The whole line is enclosed with double quotes. For easire
reading , set up the PDF FileName and Path as variables.
Believe what your looking for is something like this:

Dim strFileName as String, strPDFPath as String
strFileName = Me.[form field name]
strPDFPath = "[Drive Letter]:\[path]"

stAppName = "C:\Program Files\Adobe\Acrobat 6.0
\Reader\AcroRd32.exe " & strPDFPath & strFileName & ".pdf"
Call Shell(stAppName, 1)

-----Original Message-----
Hi
I have a command button on my form which
opens "c:\Adobe/Acrobat 6.0\reader\AcroRd 32.exe" so far
so good, but I want to go further and get it to open the
file saved as per auto number on the form. Do you think
this can be done? In other wards I have supplementary
documents associated with my data base and need to access
them and as pdf files take up the least space that is the
format they have been saved in.

Hope you can help

With thanks

Frank
.

.


.
 
Please reread my suggestion. You didn't implement it correctly!

Try:

stAppName = """C:\Program Files\Adobe\Acrobat 6.0
\Reader\AcroRd32.exe"" """ & strPDFPath & strFileName
& ".pdf"""

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Doug - Thank you
I have changed as per your advice:
Dim stAppName As String, strPDFPath As String
strFileName = Me.[Auto Number]
strPDFPath = "D:\Patient Copy Account"

stAppName = """C:\Program Files\Adobe\Acrobat 6.0
\Reader\AcroRd32.exe""" & strPDFPath & strFileName
& ".pdf"""
Call Shell(stAppName, 1)

Exit_PATIENT_COPY_ACCOUNT_Click:
Exit Sub

Err_PATIENT_COPY_ACCOUNT_Click:
MsgBox Err.Description
Resume Exit_PATIENT_COPY_ACCOUNT_Click

End Sub
However when activated the Reader opens with an error
message
"There is an error opening this document. The file name,
directory name, or volume lable syntex is incorrect."
Any furthers ideas? Sorry to keep bothering you

With thanks
Frank
-----Original Message-----
You don't have a space between Acrord32.exe and the value of strPDFPath,
which Virgil explicitly mentioned.

strPDFPath should be = "D:\Patient Copy Account", not "[D]:\[Patient Copy
Account]"

Since your file names have blanks in them, you need to enclose them in
quotes.

stAppName = """C:\Program Files\Adobe\Acrobat 6.0 \Reader\AcroRd32.exe""
""" & strPDFPath & strAutoNumber & ".pdf"""

or

stAppName = Chr$(34) & "C:\Program Files\Adobe\Acrobat
6.0\Reader\AcroRd32.exe" & Chr$(34) & " " & Chr$(34) & strPDFPath &
strAutoNumber & ".pdf" & Chr$(34)


--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Virgil
I followed your instructions as best I could but on
pressing command button get "cant find file" message. here
is what I put in
Private Sub PATIENT_COPY_ACCOUNT_Click()
On Error GoTo Err_PATIENT_COPY_ACCOUNT_Click

Dim stAppName As String, strPDFPath As String
strFileName = Me.[Auto Number]
strPDFPath = "[D]:\[Patient Copy Account]"

stAppName = "C:\Program Files\Adobe\Acrobat 6.0
\Reader\AcroRd32.exe" & strPDFPath & strAutoNumber & ".pdf"
Call Shell(stAppName, 1)

Exit_PATIENT_COPY_ACCOUNT_Click:
Exit Sub

Err_PATIENT_COPY_ACCOUNT_Click:
MsgBox Err.Description
Resume Exit_PATIENT_COPY_ACCOUNT_Click

End Sub
is it correct?
My pdf files are saved under the auto number assigned to
the form.

Regards Frank
-----Original Message-----
You can open a particular application and file by
providing the file path and name after the command line
of
the application. The application command line and
location of file are separated by a space:

"[Drive Letter]:\[application path and exe name][space]
[Drive Letter]:\[file path and name]"
The whole line is enclosed with double quotes. For easire
reading , set up the PDF FileName and Path as variables.
Believe what your looking for is something like this:

Dim strFileName as String, strPDFPath as String
strFileName = Me.[form field name]
strPDFPath = "[Drive Letter]:\[path]"

stAppName = "C:\Program Files\Adobe\Acrobat 6.0
\Reader\AcroRd32.exe " & strPDFPath & strFileName & ".pdf"
Call Shell(stAppName, 1)

-----Original Message-----
Hi
I have a command button on my form which
opens "c:\Adobe/Acrobat 6.0\reader\AcroRd 32.exe" so far
so good, but I want to go further and get it to open the
file saved as per auto number on the form. Do you think
this can be done? In other wards I have supplementary
documents associated with my data base and need to
access
them and as pdf files take up the least space that is
the
format they have been saved in.

Hope you can help

With thanks

Frank
.

.


.
 
Implemented as you set out:
stAppName = """C:\Program Files\Adobe\Acrobat 6.0
\Reader\AcroRd32.exe"" """ & strPDFPath & strFileName
& ".pdf"""
again it opens reader; however new error message
"There was an error opening this document. The file cannot
be found.

Frank
Call Shell(stAppName, 1)
-----Original Message-----
Please reread my suggestion. You didn't implement it correctly!

Try:

stAppName = """C:\Program Files\Adobe\Acrobat 6.0
\Reader\AcroRd32.exe"" """ & strPDFPath & strFileName
& ".pdf"""

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Doug - Thank you
I have changed as per your advice:
Dim stAppName As String, strPDFPath As String
strFileName = Me.[Auto Number]
strPDFPath = "D:\Patient Copy Account"

stAppName = """C:\Program Files\Adobe\Acrobat 6.0
\Reader\AcroRd32.exe""" & strPDFPath & strFileName
& ".pdf"""
Call Shell(stAppName, 1)

Exit_PATIENT_COPY_ACCOUNT_Click:
Exit Sub

Err_PATIENT_COPY_ACCOUNT_Click:
MsgBox Err.Description
Resume Exit_PATIENT_COPY_ACCOUNT_Click

End Sub
However when activated the Reader opens with an error
message
"There is an error opening this document. The file name,
directory name, or volume lable syntex is incorrect."
Any furthers ideas? Sorry to keep bothering you

With thanks
Frank
-----Original Message-----
You don't have a space between Acrord32.exe and the
value
of strPDFPath,
which Virgil explicitly mentioned.

strPDFPath should be = "D:\Patient Copy Account", not "[D]:\[Patient Copy
Account]"

Since your file names have blanks in them, you need to enclose them in
quotes.

stAppName = """C:\Program Files\Adobe\Acrobat 6.0 \Reader\AcroRd32.exe""
""" & strPDFPath & strAutoNumber & ".pdf"""

or

stAppName = Chr$(34) & "C:\Program Files\Adobe\Acrobat
6.0\Reader\AcroRd32.exe" & Chr$(34) & " " & Chr$(34) & strPDFPath &
strAutoNumber & ".pdf" & Chr$(34)


--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Virgil
I followed your instructions as best I could but on
pressing command button get "cant find file" message. here
is what I put in
Private Sub PATIENT_COPY_ACCOUNT_Click()
On Error GoTo Err_PATIENT_COPY_ACCOUNT_Click

Dim stAppName As String, strPDFPath As String
strFileName = Me.[Auto Number]
strPDFPath = "[D]:\[Patient Copy Account]"

stAppName = "C:\Program Files\Adobe\Acrobat 6.0
\Reader\AcroRd32.exe" & strPDFPath & strAutoNumber & ".pdf"
Call Shell(stAppName, 1)

Exit_PATIENT_COPY_ACCOUNT_Click:
Exit Sub

Err_PATIENT_COPY_ACCOUNT_Click:
MsgBox Err.Description
Resume Exit_PATIENT_COPY_ACCOUNT_Click

End Sub
is it correct?
My pdf files are saved under the auto number assigned to
the form.

Regards Frank
-----Original Message-----
You can open a particular application and file by
providing the file path and name after the command line
of
the application. The application command line and
location of file are separated by a space:

"[Drive Letter]:\[application path and exe name] [space]
[Drive Letter]:\[file path and name]"
The whole line is enclosed with double quotes. For easire
reading , set up the PDF FileName and Path as variables.
Believe what your looking for is something like this:

Dim strFileName as String, strPDFPath as String
strFileName = Me.[form field name]
strPDFPath = "[Drive Letter]:\[path]"

stAppName = "C:\Program Files\Adobe\Acrobat 6.0
\Reader\AcroRd32.exe " & strPDFPath & strFileName & ".pdf"
Call Shell(stAppName, 1)

-----Original Message-----
Hi
I have a command button on my form which
opens "c:\Adobe/Acrobat 6.0\reader\AcroRd 32.exe"
so
far
so good, but I want to go further and get it to
open
the
file saved as per auto number on the form. Do you think
this can be done? In other wards I have supplementary
documents associated with my data base and need to
access
them and as pdf files take up the least space that is
the
format they have been saved in.

Hope you can help

With thanks

Frank
.

.



.


.
 
Do you perhaps need a slash between strPDFPath and strFileName?

If that fails, check out http://www.mvps.org/access/api/api0018.htm at "The
Access Web" for how to use ShellExecute, so that all you need to include is
the file path, not the path to acrord32.exe.

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Implemented as you set out:
stAppName = """C:\Program Files\Adobe\Acrobat 6.0
\Reader\AcroRd32.exe"" """ & strPDFPath & strFileName
& ".pdf"""
again it opens reader; however new error message
"There was an error opening this document. The file cannot
be found.

Frank
Call Shell(stAppName, 1)
-----Original Message-----
Please reread my suggestion. You didn't implement it correctly!

Try:

stAppName = """C:\Program Files\Adobe\Acrobat 6.0
\Reader\AcroRd32.exe"" """ & strPDFPath & strFileName
& ".pdf"""

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Doug - Thank you
I have changed as per your advice:
Dim stAppName As String, strPDFPath As String
strFileName = Me.[Auto Number]
strPDFPath = "D:\Patient Copy Account"

stAppName = """C:\Program Files\Adobe\Acrobat 6.0
\Reader\AcroRd32.exe""" & strPDFPath & strFileName
& ".pdf"""
Call Shell(stAppName, 1)

Exit_PATIENT_COPY_ACCOUNT_Click:
Exit Sub

Err_PATIENT_COPY_ACCOUNT_Click:
MsgBox Err.Description
Resume Exit_PATIENT_COPY_ACCOUNT_Click

End Sub
However when activated the Reader opens with an error
message
"There is an error opening this document. The file name,
directory name, or volume lable syntex is incorrect."
Any furthers ideas? Sorry to keep bothering you

With thanks
Frank
-----Original Message-----
You don't have a space between Acrord32.exe and the value
of strPDFPath,
which Virgil explicitly mentioned.

strPDFPath should be = "D:\Patient Copy Account",
not "[D]:\[Patient Copy
Account]"

Since your file names have blanks in them, you need to
enclose them in
quotes.

stAppName = """C:\Program Files\Adobe\Acrobat 6.0
\Reader\AcroRd32.exe""
""" & strPDFPath & strAutoNumber & ".pdf"""

or

stAppName = Chr$(34) & "C:\Program Files\Adobe\Acrobat
6.0\Reader\AcroRd32.exe" & Chr$(34) & " " & Chr$(34) &
strPDFPath &
strAutoNumber & ".pdf" & Chr$(34)


--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Virgil
I followed your instructions as best I could but on
pressing command button get "cant find file" message.
here
is what I put in
Private Sub PATIENT_COPY_ACCOUNT_Click()
On Error GoTo Err_PATIENT_COPY_ACCOUNT_Click

Dim stAppName As String, strPDFPath As String
strFileName = Me.[Auto Number]
strPDFPath = "[D]:\[Patient Copy Account]"

stAppName = "C:\Program Files\Adobe\Acrobat 6.0
\Reader\AcroRd32.exe" & strPDFPath & strAutoNumber
& ".pdf"
Call Shell(stAppName, 1)

Exit_PATIENT_COPY_ACCOUNT_Click:
Exit Sub

Err_PATIENT_COPY_ACCOUNT_Click:
MsgBox Err.Description
Resume Exit_PATIENT_COPY_ACCOUNT_Click

End Sub
is it correct?
My pdf files are saved under the auto number assigned to
the form.

Regards Frank
-----Original Message-----
You can open a particular application and file by
providing the file path and name after the command line
of
the application. The application command line and
location of file are separated by a space:

"[Drive Letter]:\[application path and exe name] [space]
[Drive Letter]:\[file path and name]"
The whole line is enclosed with double quotes. For
easire
reading , set up the PDF FileName and Path as
variables.
Believe what your looking for is something like this:

Dim strFileName as String, strPDFPath as String
strFileName = Me.[form field name]
strPDFPath = "[Drive Letter]:\[path]"

stAppName = "C:\Program Files\Adobe\Acrobat 6.0
\Reader\AcroRd32.exe " & strPDFPath & strFileName
& ".pdf"
Call Shell(stAppName, 1)

-----Original Message-----
Hi
I have a command button on my form which
opens "c:\Adobe/Acrobat 6.0\reader\AcroRd 32.exe" so
far
so good, but I want to go further and get it to open
the
file saved as per auto number on the form. Do you
think
this can be done? In other wards I have supplementary
documents associated with my data base and need to
access
them and as pdf files take up the least space that is
the
format they have been saved in.

Hope you can help

With thanks

Frank
.

.



.


.
 
Thank you Douglas for all your help. I got it to work when
I moved the PDF files to the D:\ root directory and took
out the sub directory Patient Copt Account.

Again Thank You
-----Original Message-----
Do you perhaps need a slash between strPDFPath and strFileName?

If that fails, check out
http://www.mvps.org/access/api/api0018.htm at "The
Access Web" for how to use ShellExecute, so that all you need to include is
the file path, not the path to acrord32.exe.

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Implemented as you set out:
stAppName = """C:\Program Files\Adobe\Acrobat 6.0
\Reader\AcroRd32.exe"" """ & strPDFPath & strFileName
& ".pdf"""
again it opens reader; however new error message
"There was an error opening this document. The file cannot
be found.

Frank
Call Shell(stAppName, 1)
-----Original Message-----
Please reread my suggestion. You didn't implement it correctly!

Try:

stAppName = """C:\Program Files\Adobe\Acrobat 6.0
\Reader\AcroRd32.exe"" """ & strPDFPath & strFileName
& ".pdf"""

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Doug - Thank you
I have changed as per your advice:
Dim stAppName As String, strPDFPath As String
strFileName = Me.[Auto Number]
strPDFPath = "D:\Patient Copy Account"

stAppName = """C:\Program Files\Adobe\Acrobat 6.0
\Reader\AcroRd32.exe""" & strPDFPath & strFileName
& ".pdf"""
Call Shell(stAppName, 1)

Exit_PATIENT_COPY_ACCOUNT_Click:
Exit Sub

Err_PATIENT_COPY_ACCOUNT_Click:
MsgBox Err.Description
Resume Exit_PATIENT_COPY_ACCOUNT_Click

End Sub
However when activated the Reader opens with an error
message
"There is an error opening this document. The file name,
directory name, or volume lable syntex is incorrect."
Any furthers ideas? Sorry to keep bothering you

With thanks
Frank
-----Original Message-----
You don't have a space between Acrord32.exe and the value
of strPDFPath,
which Virgil explicitly mentioned.

strPDFPath should be = "D:\Patient Copy Account",
not "[D]:\[Patient Copy
Account]"

Since your file names have blanks in them, you need to
enclose them in
quotes.

stAppName = """C:\Program Files\Adobe\Acrobat 6.0
\Reader\AcroRd32.exe""
""" & strPDFPath & strAutoNumber & ".pdf"""

or

stAppName = Chr$(34) & "C:\Program Files\Adobe\Acrobat
6.0\Reader\AcroRd32.exe" & Chr$(34) & " " & Chr$(34) &
strPDFPath &
strAutoNumber & ".pdf" & Chr$(34)


--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Virgil
I followed your instructions as best I could but on
pressing command button get "cant find file" message.
here
is what I put in
Private Sub PATIENT_COPY_ACCOUNT_Click()
On Error GoTo Err_PATIENT_COPY_ACCOUNT_Click

Dim stAppName As String, strPDFPath As String
strFileName = Me.[Auto Number]
strPDFPath = "[D]:\[Patient Copy Account]"

stAppName = "C:\Program Files\Adobe\Acrobat 6.0
\Reader\AcroRd32.exe" & strPDFPath & strAutoNumber
& ".pdf"
Call Shell(stAppName, 1)

Exit_PATIENT_COPY_ACCOUNT_Click:
Exit Sub

Err_PATIENT_COPY_ACCOUNT_Click:
MsgBox Err.Description
Resume Exit_PATIENT_COPY_ACCOUNT_Click

End Sub
is it correct?
My pdf files are saved under the auto number assigned to
the form.

Regards Frank
-----Original Message-----
You can open a particular application and file by
providing the file path and name after the
command
line
of
the application. The application command line and
location of file are separated by a space:

"[Drive Letter]:\[application path and exe name] [space]
[Drive Letter]:\[file path and name]"
The whole line is enclosed with double quotes. For
easire
reading , set up the PDF FileName and Path as
variables.
Believe what your looking for is something like this:

Dim strFileName as String, strPDFPath as String
strFileName = Me.[form field name]
strPDFPath = "[Drive Letter]:\[path]"

stAppName = "C:\Program Files\Adobe\Acrobat 6.0
\Reader\AcroRd32.exe " & strPDFPath & strFileName
& ".pdf"
Call Shell(stAppName, 1)

-----Original Message-----
Hi
I have a command button on my form which
opens "c:\Adobe/Acrobat 6.0\reader\AcroRd
32.exe"
so
far
so good, but I want to go further and get it to open
the
file saved as per auto number on the form. Do you
think
this can be done? In other wards I have supplementary
documents associated with my data base and need to
access
them and as pdf files take up the least space
that
is
the
format they have been saved in.

Hope you can help

With thanks

Frank
.

.



.



.


.
 
Back
Top