Hello !!

I have a word document into an "general" field ( texte1)
i use this :

oword=createobject("Word.application")
with oword
@ 1,1 say texte1 verb 0 nowait
wait "" timeout 5 && wzit for word
oword.visible=.T.
oword.application.activate
oword.activeprinter="Adobe PDF" && change printer
.Wordbasic.Fileprint(0)
oword.documents.close(0)
.application.Quit(0)
endwith
release oword

but , i dont know how to put the file name and the path for create the pdf.
I want to create my pdf into c:\mydir\myfilename.pdf

if somebody can help me.

Thanks a lot

Re: adobe pdf & fox 6,7 and 9 by tim_witort

tim_witort
Mon Jun 12 12:01:40 CDT 2006

laurent-833 seemed to utter in
news:4486ec74$0$1602$636a55ce@news.free.fr:

> Hello !!
>
> I have a word document into an "general" field ( texte1)
> i use this :
>
> oword=createobject("Word.application")
> with oword
> @ 1,1 say texte1 verb 0 nowait
> wait "" timeout 5 && wzit for word
> oword.visible=.T.
> oword.application.activate
> oword.activeprinter="Adobe PDF" && change printer
> .Wordbasic.Fileprint(0)
> oword.documents.close(0)
> .application.Quit(0)
> endwith
> release oword
>
> but , i dont know how to put the file name and the path for create the
> pdf. I want to create my pdf into c:\mydir\myfilename.pdf
>
> if somebody can help me.
>
> Thanks a lot

The part you are missing is setting the output file name for
the PDF Writer before you print the Word file. This is done
by setting a couple of registry entries. This may vary slightly
depending on what version of Acrobat you're using. This is
for Acrobat 5.0 using the PDF Writer printer:

LPARAMETERS tcPDFFile

*------------------------------ Local Variables ---------------------------
LOCAL loRegistry
*----------------------------- Method Code Begin --------------------------

*
* Create an instance of the registry tool:
*
loRegistry = CREATEOBJECT("registry")

*
* Set the output file name:
*
loRegistry.SetRegKey("PDFFileName", tcPDFFile, ;
"Software\Adobe\Acrobat PDFWriter", HKEY_CURRENT_USER)

*
* Make sure PDF Writer is not set to open Acrobat after printing:
*
loRegistry.SetRegKey("bExecViewer", "0", ;
"Software\Adobe\Acrobat PDFWriter", HKEY_CURRENT_USER)

-- TRW
_______________________________________
t i m
a t
w i t o r t d o t c o m
_______________________________________