Rajesh Karunakaran
Programmer
Hi Team,
I have a form. I have dropped Microsoft Web Browser OLE control.
I have a button on form. On CLICK of button I have following code (took from
But when I select a PDF to view, the form itself getting closed.
However, I can view the PDF in Acrobat Reader or if I drop the file in my Chrome browser, it is displayed.
Mine is Windows 10, 64bit
Anyone has any idea ?
Thanks
Rajesh
I have a form. I have dropped Microsoft Web Browser OLE control.
I have a button on form. On CLICK of button I have following code (took from
Code:
LOCAL lnSeconds
Thisform.cPdfFileName = GETFILE("pdf")
This.nPdfLoadTimeout = 30
* Clear Web browser control by loading blank page
Thisform.oWB.OBJECT.Navigate2("About:Blank")
* Wait for load to complete
lnSeconds = SECONDS()
DO WHILE (Thisform.oWB.OBJECT.Busy OR Thisform.oWB.OBJECT.ReadyState <> 4) ;
AND (SECONDS() - lnSeconds) < This.nPdfLoadTimeout
DOEVENTS
ENDDO
* Load PDF
WAIT WINDOW NOWAIT "Loading PDF ..."
Thisform.oWB.OBJECT.Navigate2(Thisform.cPdfFileName)
* Wait for PDF to load
lnSeconds = SECONDS()
DO WHILE (Thisform.oWB.OBJECT.Busy OR Thisform.oWB.OBJECT.ReadyState <> 4) ;
AND (SECONDS() - lnSeconds) < This.nPdfLoadTimeout
DOEVENTS
ENDDO
WAIT CLEAR
But when I select a PDF to view, the form itself getting closed.
However, I can view the PDF in Acrobat Reader or if I drop the file in my Chrome browser, it is displayed.
Mine is Windows 10, 64bit
Anyone has any idea ?
Thanks
Rajesh