PC Review


Reply
Thread Tools Rate Thread

Creating a path and opening a PDF File

 
 
Chez
Guest
Posts: n/a
 
      28th Oct 2008
I have PDF files saved on our server that relate to each record in my
database. I'm trying to create a command button that will create a path to
these files and do one of two things.

1. Create the path and open the PDF file in Acrobat Reader.
OR
2. Create the path and display a particular PDF file within a Form.

I'd prefer to do option #2. I can currently do option #2 with an image
using the following code below.

Dim strImagePath As String
Dim strMDBPath As String
Dim intSlashLoc As String

On Error Resume Next
strMDBPath = CurrentProject.FullName

intSlashLoc = InStrRev(strMDBPath, "\", Len(strMDBPath))

strImagePath = Left(strMDBPath, intSlashLoc) & _
Me.txtImageName

Me.imageframe.Picture = strImagePath

PLEASE HELP

 
Reply With Quote
 
 
 
 
Daniel Pineault
Guest
Posts: n/a
 
      28th Oct 2008
For option 1., use the application.followhyperlink method. Try something like:

Dim strPDFPath As String

On Error Resume Next

strPDFPath = CurrentProject.Path & "\" & Me.txtPDFName

Application.FollowHyperlink strPDFPath
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.



"Chez" wrote:

> I have PDF files saved on our server that relate to each record in my
> database. I'm trying to create a command button that will create a path to
> these files and do one of two things.
>
> 1. Create the path and open the PDF file in Acrobat Reader.
> OR
> 2. Create the path and display a particular PDF file within a Form.
>
> I'd prefer to do option #2. I can currently do option #2 with an image
> using the following code below.
>
> Dim strImagePath As String
> Dim strMDBPath As String
> Dim intSlashLoc As String
>
> On Error Resume Next
> strMDBPath = CurrentProject.FullName
>
> intSlashLoc = InStrRev(strMDBPath, "\", Len(strMDBPath))
>
> strImagePath = Left(strMDBPath, intSlashLoc) & _
> Me.txtImageName
>
> Me.imageframe.Picture = strImagePath
>
> PLEASE HELP
>

 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      28th Oct 2008
I don't believe it's possible to display the PDF within a form anymore: it's
been years since Adobe supported the ActiveX control to display PDFs.

To open the file in Acrobat Reader (or whatever program has been associated
with the PDF extension on the user's machine), use

Application.FollowHyperlink strImagePath

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Chez" <(E-Mail Removed)> wrote in message
news:563B6358-2185-433E-B9A2-(E-Mail Removed)...
>I have PDF files saved on our server that relate to each record in my
> database. I'm trying to create a command button that will create a path
> to
> these files and do one of two things.
>
> 1. Create the path and open the PDF file in Acrobat Reader.
> OR
> 2. Create the path and display a particular PDF file within a Form.
>
> I'd prefer to do option #2. I can currently do option #2 with an image
> using the following code below.
>
> Dim strImagePath As String
> Dim strMDBPath As String
> Dim intSlashLoc As String
>
> On Error Resume Next
> strMDBPath = CurrentProject.FullName
>
> intSlashLoc = InStrRev(strMDBPath, "\", Len(strMDBPath))
>
> strImagePath = Left(strMDBPath, intSlashLoc) & _
> Me.txtImageName
>
> Me.imageframe.Picture = strImagePath
>
> PLEASE HELP
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
opening files - autocomplete file path jim Microsoft Word Document Management 1 23rd Feb 2010 07:59 PM
File Path validation without file creating functions Mohammad Omer Microsoft VC .NET 7 24th Sep 2009 09:06 PM
Opening dotx files are opening the file itself instead of creating Jeanjacket Microsoft Word Document Management 1 7th Aug 2009 01:38 AM
Creating Excel file that points to relative path .cub file NewUser1 Microsoft Excel Programming 0 11th Jan 2008 03:59 PM
Creating a path to save a file =?Utf-8?B?T2xkamF5?= Microsoft Excel Programming 5 6th Aug 2007 04:24 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:24 AM.