Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Acrobat Writer/VFP 6.0 1

Status
Not open for further replies.

michlm

Programmer
Sep 3, 2000
44
0
0
US
I'm creating a screen with a function that allows the user to export a graph to Acrobat Writer. What I need to do on the screen is enable the export function ONLY if the user has Acrobat Writer installed on their PC. Can anyone help me with what I would need to do to determine through code whether or not Acrobat Writer is installed on the user's PC?

TIA,

Michelle
 
The simplest way I can think of would be to attempt to create an Acrobat object and trap for errors. If the object could not be created, they probably don't have it installed.

Ian
 
Another option is to loop through APrinters() array to see if it exists.


Stephen
 
Michelle

If there are specific file extentions associated with any Acrobat Writer executable, ignoring .pdf, then you can use a WinAPI call to establish if Acrobat Writer exists by virtue of the file extension's association with the relevant executable.

.pdf, for example will normally be associated with Acrobat Reader and the WinAPI call will return the path of Acrobat Reader.

If the WinAPI call using .pdf returned a blank, you would know the user did not have the Acrobat Reader installed.
HTH

Chris [pc2]
 
The way I do it is to check for the existance of the PDFWriter printer in the printer list, like this (on a form with a "Presentation" radio button group that allows the user to select the output format):
#DEFINE PDFWRITER "ACROBAT PDFWRITER"
public aPrts
dimension aPrts[1,2]
if aprinters(aPrts) = 0
dimension aPrts[1,2]
aPrts[1,1] = ""
aPrts[1,2] = ""
endif
* Disable PDF option if PDFWriter is not installed
if ascan(aPrts,PDFWRITER) = 0
Thisform.rbg_Presentation.rb_CreatePDF.value = 0
Thisform.rbg_Presentation.rb_CreatePDF.Enabled = .F.
endif

 
Mike_K - That's exactly what I was looking for. Thanks so much for you help.

Everyone - thank you for all of the different ideas! Much appreciated.

Michelle
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top