Abrir Documentos deOffice

Hola a todos!!!
Como hago para abrir un archivo de word DESDE visual fox pro 6.0 por medio de comandos?
Gracias por la atencion prestada.

1 respuesta

Supongo que además necesitas la automatización, por lo que te remito un ejemplo que te enseña a hacer ambas cosas.
Por favor, estúdialo y ve que provecho puedes obtener de él.
Good, I suppose that you also need the automation, for what I remit you an example that becomes trained to make both things.
Please, study it and you see that profit can obtain of him.
***/ Begin program code /***
* Code to create a new data source to a VFP table.
* Use the Declare DLL function to prototype the
* SQLConfigDataSource function.
* Using SQLConfigDataSource prevents having to go into
* the ODBC Driver Manager and create the DSN.
DECLARE Integer SQLConfigDataSource in odbccp32.dll Integer, ;
Integer, String, String
* Create a string containing the settings appropriate to the driver.
* The following is an example for the Microsoft VFP ODBC driver
* accessing the Customer.dbf file.
*** Change the path below to point to the Customer table ***
*** in the \Samples\Data folder. ***
settings="DSN=visual foxpro tables"+chr(0)+;
"Description=VFP ODBC Driver"+chr(0)+;
=SQLConfigDataSource(0,1,"Microsoft Visual FoxPro Driver",settings)
* NOTE: Ensure there are no spaces on either side of the equal sign (=).
ON ERROR DO errhand WITH ERROR(), MESSAGE(), MESSAGE(1), PROGRAM( ), LINENO( ) && Trap OLE & other errors.
* Initialize variables passed to Word to create form letter.
intro1="Congratulations! You are one of our best customers since you purchase $"
intro2=" each month from us. "
Intro3="As a result, your maximum order amount has been increased by $2500.00. If you have any questions, please feel free to contact us."
oWord = CREATEOBJECT("Word.Application")
WITH oWord
* Assign values to variables
wconn="DSN=visual foxpro tables;uid=;pwd=;"+;
wsqlstatement="SELECT contact,company,title,address,city,;
postalcode,STR(maxordamt,12,2) as maxordamt FROM customer ;
WHERE (customer.maxordamt>$100000)"
.Visible=.T. && Make Word visible.
.WindowState = 2 && Minimize Word.
.Documents.Add && Add new document.
Wprotectdoc, wprotecttemp, wconn, wsqlstatement)
.Selection.InsertDateTime("dddd, MMMM dd, yyyy", 1)
(OWord. Selection. Range,"contact")
(OWord. Selection. Range,"company")
(OWord. Sel

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas