This.AddObject("owb","oleControl","Shell.Explorer.2")
This.oWb.Top = 0
This.oWb.Left = 0
This.oWb.Width = Thisform.Width
This.oWb.Height = Thisform.Height
This.oWb.Visible = .T.
This.oWb.Anchor = 240
This.AddProperty("cPDFFileName","")
This.AddProperty("nPdfLoadTimeout",30)
* Get PDF file name
Thisform.cPdfFileName = Getfile("pdf")
* Display the name in the textbox
This.Caption = Thisform.cPdfFileName
If Not Empty(Thisform.cPdfFileName)
* Display PDF
Thisform.ShowPdf()
Endif
Suena interesante conocer un poco de tu Sistema de Control de
documentos, yo tambien estoy implemento uno.
Con relacion a tu pregunta te muestro a continuacion como ejemplo un
codigo simple y funcional para ver Archivos PDF
*********************************************************
* Vizualizar Archivos PDF desde un Formulario.
*********************************************************
PUBLIC oform1
oform1=NEWOBJECT("form1")
oform1.Show
RETURN
**************************************************
DEFINE CLASS form1 AS form
DoCreate = .T.
Caption = "Visualizar Archivo PDF"
Icon = "C:\CONTROL90\APLICACION\ICONOS\ADOBE_DOC.ICO"
Name = "Form1"
WindowState = 2
ADD OBJECT cmdfile AS commandbutton WITH ;
Top = 12, ;
Left = 12, ;
Height = 27, ;
Width = 144, ;
Caption = "Select File", ;
Name = "cmdfile"
ADD OBJECT cmdexit AS commandbutton WITH ;
Top = 12, ;
Left = 168, ;
Height = 27, ;
Width = 84, ;
Caption = "E\<xit", ;
Name = "cmdexit"
ADD OBJECT olecontrol1 AS olecontrol WITH ;
OLECLASS = "AcroPDF.PDF.1", ;
Top = 48, ;
Left = 12, ;
Height = 192, ;
Width = 348, ;
Name = "Olecontrol1"
PROCEDURE Init
ThisForm.ReSize
ENDPROC
PROCEDURE ReSize
Thisform.Olecontrol1.Height = Thisform.Height + 354
Thisform.Olecontrol1.Width = Thisform.Width + 316
Thisform.Olecontrol1.Refresh()
ENDPROC
PROCEDURE cmdfile.Click
LOCAL cFile
cFile = GETFILE([PDF])
IF !EMPTY(cFile)
Thisform.Olecontrol1.LoadFile([&cFile])
ENDIF
ENDPROC
PROCEDURE cmdexit.Click
ThisForm.Release()
ENDPROC
ENDDEFINE
Saludos,
Gabriel
(Lima-Perú)
Encontré este correo en el baúl de los trucos.. pero no logro hacerlo
funcionar, aparentemente no logra encontrar esto " AcroPDF.PDF.1".
Existe alguna manera de regístralo.. cual sería su OCX o DLL?
-----Mensaje original-----
De: mundovis...@googlegroups.com
[mailto:mundovis...@googlegroups.com] En nombre de integral
Enviado el: Viernes, 05 de Marzo de 2010 12:57 p.m.
Para: Mundo Visual FoxPro
Asunto: [Mundo Visual FoxPro] Re: Ejecutar Acrobat reader desde VFP
Que tal :
PROCEDURE Init
ThisForm.ReSize
ENDPROC
PROCEDURE cmdexit.Click
ThisForm.Release()
ENDPROC
ENDDEFINE
Saludos,
Gabriel
(Lima-Perú)
--
_______________________________________________________________
Has recibido este mensaje porque estás suscrito al Grupo "Mundo Visual
FoxPro" de Grupos de Google.
Para anular la suscripción a este grupo, envía un mensaje a:
mundovisualfox...@googlegroups.com
__________ Información de ESET NOD32 Antivirus, versión de la base de firmas
de virus 4918 (20100305) __________
ESET NOD32 Antivirus ha comprobado este mensaje.
gcOldDir = SET('DEFAULT') + SYS(2003)
oShell = CreateObject("WScript.Shell")
*ruta = SYS(5)+SYS(2003) && La ruta puede ser "C:\carpeta\mifichero"
ruta = \\192.168.0.199\docum\ofic
oShell.Run("&ruta\certific.pdf",1,.f.) && Ejecuta el Acrobat y abre el fichero .PDF
dxw='SET DEFAULT TO "'+gcOldDir+'"'
&dxw
ELSE
MESSAGEBOX
('No encontró documento',16,'NADA PARA MOSTRAR')ENDIF
Espero ser de ayuda.....