Open PDF
am 09.01.2008 18:53:40 von onefootout
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
am 09.01.2008 19:22:07 von Salad
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
am 09.01.2008 19:44:12 von onefootout
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
am 09.01.2008 20:42:23 von onefootout
On Jan 9, 1:44 pm, onefootout 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
am 09.01.2008 20:47:32 von none
"onefootout" wrote in message
news:fac3aa18-0fbe-4282-b974-798d306db177@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
am 09.01.2008 21:30:10 von onefootout
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
am 09.01.2008 21:41:46 von none
"onefootout" wrote in message
news:caa4cbcc-90ad-4f78-a870-efffd4015162@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
am 09.01.2008 21:45:10 von Salad
onefootout wrote:
> On Jan 9, 1:44 pm, onefootout 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
am 09.01.2008 21:46:18 von none
"onefootout" wrote in message
news:429ef342-b339-4aa9-b73c-a88807382112@f47g2000hsd.google groups.com...
> On Jan 9, 1:44 pm, onefootout 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
am 09.01.2008 22:03:16 von onefootout
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
am 10.01.2008 15:24:09 von Salad
paii, Ron wrote:
> "onefootout" wrote in message
> news:429ef342-b339-4aa9-b73c-a88807382112@f47g2000hsd.google groups.com...
>
>>On Jan 9, 1:44 pm, onefootout 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
am 11.01.2008 00:05:12 von Patrick Fisher
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
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!!!!