Subject Re: Macro for Acrobat Reader and open a file at same time
From Ken Mayer <dbase@nospam.goldenstag.net>
Date Mon, 27 Feb 2023 09:48:03 -0800
Newsgroups dbase.getting-started

On 2/27/2023 9:24 AM, Stuart Tobin wrote:
> I can create a macro with the location of Acrobat Reader. I want to be able to also have that macro open a file whose name I have placed in a variable.
> Reason is different locations and versions of Reader. So Reader location is passed from record to variable to Macro.
>
> Whole concept: Use listbox to select a .pdf. Then have it opened by Reader through code.
> Can this be done?

If Acrobat Reader is the default (it usually is) for reading a PDF,
you're doing too much work ... ;)

In the dUFLP's "MiscAPI.prg" is a function called "Open_URL" which of
course sounds like it only works for web addresses, but ...

Tested with a PDF on my machine:

set procedure to :dUFLP:MiscAPI
openurl( "C:\SomeFiles\mypdf.pdf" )
close procedure :dUFLP:MiscAPI

Works perfectly ... opens the file in Acrobat Reader, and all is good.

Ken

--
*Ken Mayer*
Ken's dBASE Page: http://www.goldenstag.net/dbase
The dUFLP: http://www.goldenstag.net/dbase/index.htm#duflp
dBASE Books: http://www.goldenstag.net/dbase/Books/dBASEBooks.htm
dBASE Tutorial: http://www.goldenstag.net/dbase/Tutorial/00_Preface.htm
dBASE Web Tutorial: http://www.goldenstag.net/dbase/WebTutorial/00_Menu.htm
dBASE DOS to Windows Tutorial:
http://www.goldenstag.net/dbase/DtoWTutorial/00_Menu.htm