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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hypertext on form 1

Status
Not open for further replies.

samsnead

Programmer
Sep 3, 2005
100
CA
I have put hypertext on form using shellexecute command to open the html file - however, IE always opens full screen - does anyone know if we can control size of Internet Explorer screen - and should this question be in different forum?
 
sorry: for a file on your computer:

o.navigate2("File://<<docpath+name>>")
 
Hi - that almost works but msg cannot find file (is correct filename and works with shell execute) code is below - I pass the file name to the routine. I have included the shellexecute code that works but is full screen.

LPARAMETERS showurl
LOCAL lnsuccess
STORE 0 TO lnsuccess

o = Createobject("internetexplorer.application")
o.navigate2("File://<<&showurl>>")
o.Height = 200
o.Width = 200
o.Visible = .T.


*!* IF !EMPTY(showurl)
*!* && Redeclare in case ShellExecute was cleared by another program
*!* DECLARE INTEGER ShellExecute IN shell32.dll ;
*!* INTEGER hndWin, ;
*!* STRING cAction, ;
*!* STRING cFileName, ;
*!* STRING cParams, ;
*!* STRING cDir, ;
*!* INTEGER nShowWin

*!* lnsuccess= ShellExecute(0,"open",showurl,"","",1)
*!* IF lnsuccess>31
*!* _screen.WindowState= 1
*!* endif

*!* ENDIF
*!* endproc
 
Hi Sam,
Solution of Imaginecorp works for a file if you change
o.navigate2("File://<<docpath+name>>")
in
o.navigate2("File:&showurl")
Regards,
Jockey2
 
Sorry Should have explained:

"o.navigate2("File://<<&showurl>>")"
When I put "<<" around some thing, it means it is a variable.
Also my code was an alternative to Shellexecute, you cannot use both:
So your code should be

cFile = "C:\showurl.htm" &&& if Showurl is a Htm file and is located on the C drive i.e. Include the name and fullpath.

o = Createobject("internetexplorer.application")
o.navigate2(cFile)
o.Height = 200
o.Width = 200
o.Visible = .T.

 
Thanks - that works perfectly - (using the cfile method). Much better than shell execute. Now I will fine tune so I can position based on screen size etc. (we have code to get that info from windows so should be easy).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top