Open PDF
Hi all,
I'm trying to open a PDF file from a form in access 97.
I've tried followhyperlink a few different ways, and I tried hard
coding "hyperlink address" into a form label. The only result that I
get is that the reader opens, then immediately closes.
I can open a pdf from an explorer window with no problem
I know I can use shell, but I'd rather not, because it's a mystery to
me.
Any ideas? I'm starting to get ultra frustrated.
Thanks!!!!
Re: Open PDF
onefootout wrote:
> Hi all,
>
> I'm trying to open a PDF file from a form in access 97.
>
> I've tried followhyperlink a few different ways, and I tried hard
> coding "hyperlink address" into a form label. The only result that I
> get is that the reader opens, then immediately closes.
>
> I can open a pdf from an explorer window with no problem
>
> I know I can use shell, but I'd rather not, because it's a mystery to
> me.
>
> Any ideas? I'm starting to get ultra frustrated.
>
> Thanks!!!!
I've never had a problem with
http://www.mvps.org/access/api/api0018.htm
Dealing
http://www.youtube.com/watch?v=NZwu54S94-4
Re: Open PDF
Yeah, I've seen this code before, but I'm really not savvy enough to
use it. I don't know where to put it, and I don't know how to change
it to do what I want...
What I was hoping to find out is why the followhyperlink isn't working
correctly.
Re: Open PDF
On Jan 9, 1:44 pm, onefootout <secret... [at] gmail.com> wrote:
> Yeah, I've seen this code before, but I'm really not savvy enough to
> use it. I don't know where to put it, and I don't know how to change
> it to do what I want...
>
> What I was hoping to find out is why the followhyperlink isn't working
> correctly.
Sorry, that was terse. I appreciate the suggestion.
I'm totally stumped and getting frustrated to the max, because the
solutions that I'm getting are either beyond me, or are weirdly not
working. I can't understand why the acrobat reader would open, then
immediately close. It doesn't make any sense to me at all.
I found this thread that I thought was an interesting solution... Not
sure if the "Hyperlink Addresss" property for a label can be dynamic,
but that would be a sweet solution.
http://tinyurl.com/35urw2
Re: Open PDF
"onefootout" <secretkat [at] gmail.com> wrote in message
news:fac3aa18-0fbe-4282-b974-798d306db177 [at] l32g2000hse.google groups.com...
> Yeah, I've seen this code before, but I'm really not savvy enough to
> use it. I don't know where to put it, and I don't know how to change
> it to do what I want...
>
> What I was hoping to find out is why the followhyperlink isn't working
> correctly.
Put the code in a module and call-it from an event procedure on your form.
ex.
Call fHandleFile(Me![Path], vbMaximizedFocus)
As for working in Explore, I think Explore uses the same calls that the code
in Salad's link uses.
Re: Open PDF
Put the code in a module and call-it from an event procedure on your
form.
>
> ex.
>
> Call fHandleFile(Me![Path], vbMaximizedFocus)
Ok, so I'm still kind of contused.
I put the whole piece of code into a module, untouched, and save it.
Then call it from an on_click? So I can just make a button, and flop
this: Call fHandleFile(Me![Path], vbMaximizedFocus) into the
procedure?
Re: Open PDF
"onefootout" <secretkat [at] gmail.com> wrote in message
news:caa4cbcc-90ad-4f78-a870-efffd4015162 [at] 1g2000hsl.googlegr oups.com...
> Put the code in a module and call-it from an event procedure on your
> form.
> >
> > ex.
> >
> > Call fHandleFile(Me![Path], vbMaximizedFocus)
>
> Ok, so I'm still kind of contused.
>
> I put the whole piece of code into a module, untouched, and save it.
1) Put it in a module, then edit the text to put lines of code seperated by
new lines back together.
2) Read the code to understand what it is doing. You don't know me or Salad
or Dev Ashish, be careful with "Free" code.
3) Compile to verify the code then save the module.
> Then call it from an on_click? So I can just make a button, and flop
> this: Call fHandleFile(Me![Path], vbMaximizedFocus) into the
> procedure?
Yes, but replace Me![Path] with the name of your control holding the file
name.
Re: Open PDF
onefootout wrote:
> On Jan 9, 1:44 pm, onefootout <secret... [at] gmail.com> wrote:
>
>>Yeah, I've seen this code before, but I'm really not savvy enough to
>>use it. I don't know where to put it, and I don't know how to change
>>it to do what I want...
>>
>>What I was hoping to find out is why the followhyperlink isn't working
>>correctly.
>
>
> Sorry, that was terse. I appreciate the suggestion.
>
> I'm totally stumped and getting frustrated to the max, because the
> solutions that I'm getting are either beyond me, or are weirdly not
> working. I can't understand why the acrobat reader would open, then
> immediately close. It doesn't make any sense to me at all.
>
> I found this thread that I thought was an interesting solution... Not
> sure if the "Hyperlink Addresss" property for a label can be dynamic,
> but that would be a sweet solution.
>
> http://tinyurl.com/35urw2
Taking what Ron said, open your database, make a new module, and
copy/paste the code into the module then save the module.
I usually call this routine from the Dbl-Click event that
stores/displays the file.
I might have code similar to the code below that takes a hyperlink and
opens the file.
Dim var As Variant
Dim strAddress As Variant
'get the document address. Change to reflect your hyperlink
'field name
strAddress = HyperlinkPart(Me.HyperlinkFieldName, acAddress)
'open the file maximized. Maximised = 3
var = fHandleFile(strAddress, 3)
You can see not much code is required and it works great.
You can even test it out from the Debug/Immediate window
? fHandleFile("C:\Test1.Doc",3)
About the hardest thing in this process is copy/pasting the code from
mvps.org into a module.
Re: Open PDF
"onefootout" <secretkat [at] gmail.com> wrote in message
news:429ef342-b339-4aa9-b73c-a88807382112 [at] f47g2000hsd.google groups.com...
> On Jan 9, 1:44 pm, onefootout <secret... [at] gmail.com> wrote:
> > Yeah, I've seen this code before, but I'm really not savvy enough to
> > use it. I don't know where to put it, and I don't know how to change
> > it to do what I want...
> >
> > What I was hoping to find out is why the followhyperlink isn't working
> > correctly.
>
> Sorry, that was terse. I appreciate the suggestion.
>
> I'm totally stumped and getting frustrated to the max, because the
> solutions that I'm getting are either beyond me, or are weirdly not
> working. I can't understand why the acrobat reader would open, then
> immediately close. It doesn't make any sense to me at all.
>
> I found this thread that I thought was an interesting solution... Not
> sure if the "Hyperlink Addresss" property for a label can be dynamic,
> but that would be a sweet solution.
>
> http://tinyurl.com/35urw2?wp_ml=0
You may be able to make it dynamic, but Dev Ashish's code works and I can
call it from an event procedure on any field which allows me to store paths
in the table and open any type of file with a associated file type.
Re: Open PDF
Thanks you guys, I'll give this a try, see if I can get it working for
me.
Thanks for all your help, I appreciate it a lot.
K
Re: Open PDF
paii, Ron wrote:
> "onefootout" <secretkat [at] gmail.com> wrote in message
> news:429ef342-b339-4aa9-b73c-a88807382112 [at] f47g2000hsd.google groups.com...
>
>>On Jan 9, 1:44 pm, onefootout <secret... [at] gmail.com> wrote:
>>
>>>Yeah, I've seen this code before, but I'm really not savvy enough to
>>>use it. I don't know where to put it, and I don't know how to change
>>>it to do what I want...
>>>
>>>What I was hoping to find out is why the followhyperlink isn't working
>>>correctly.
>>
>>Sorry, that was terse. I appreciate the suggestion.
>>
>>I'm totally stumped and getting frustrated to the max, because the
>>solutions that I'm getting are either beyond me, or are weirdly not
>>working. I can't understand why the acrobat reader would open, then
>>immediately close. It doesn't make any sense to me at all.
>>
>>I found this thread that I thought was an interesting solution... Not
>>sure if the "Hyperlink Addresss" property for a label can be dynamic,
>>but that would be a sweet solution.
>>
>>http://tinyurl.com/35urw2?wp_ml=0
>
>
> You may be able to make it dynamic, but Dev Ashish's code works and I can
> call it from an event procedure on any field which allows me to store paths
> in the table and open any type of file with a associated file type.
>
The thing I dislike about hyperlinks is that it executes on a
single-click. So if I click on that field, there's my doc (and the load
time). I prefer separating the link from display text and using the
dbl-click event. I suppose some folk like the single click effect but
to me it is an annoying feature where MS dictates the action, not the
developer.
Re: Open PDF
This may seem a bit obvious but I have just put
c:\pictureshow.pdf
in the Hyperlink property of a button and it woks perfectly, have you
tried this?
Patric
On Wed, 9 Jan 2008 09:53:40 -0800 (PST), onefootout
<secretkat [at] gmail.com> wrote:
>Hi all,
>
>I'm trying to open a PDF file from a form in access 97.
>
>I've tried followhyperlink a few different ways, and I tried hard
>coding "hyperlink address" into a form label. The only result that I
>get is that the reader opens, then immediately closes.
>
>I can open a pdf from an explorer window with no problem
>
>I know I can use shell, but I'd rather not, because it's a mystery to
>me.
>
>Any ideas? I'm starting to get ultra frustrated.
>
>Thanks!!!!