Greetings:
Using the following code I can open a window and attach a browser to it. With help from Larry and Sapero, I learned how to open a chm and hlp formatted help file by clicking on the help menu and selecting help.
' open a main window
WINDOW win
OPENWINDOW win,0,0,200,100,@NOAUTODRAW|@SIZE|@MINBOX|@MAXBOX,0,"BROWSER TEST",&handler
CENTERWINDOW win
' attach MSIE to the window
ATTACHBROWSER win
' build a main menu
BEGINMENU win
MENUTITLE "&File"
MENUITEM "&Close ",0,2
MENUITEM "&Save ",0,3
SEPARATOR
MENUITEM "E&xit ",0,4
MENUTITLE "&Edit"
MENUTITLE "&View"
MENUTITLE "&Help"
MENUITEM "CHM Help",0,5
MENUITEM "HLP Help",0,6
ENDMENU
' open an html web page on the hard drive
BROWSECMD win,@NAVIGATE, GetStartPath()+"index.html"
sub handler
SELECT @MESSAGE
CASE @IDCLOSEWINDOW
CLOSEWINDOW win
CASE @IDMENUPICK
SELECT @MENUNUM
CASE 4 'Exit program
CLOSEWINDOW win
CASE 5 'Select CHM style help file
SYSTEM GETSTARTPATH + "HELP1.chm"
CASE 6 'Select HLP style help file
SYSTEM GETSTARTPATH + "HELP2.hlp"
ENDSELECT
ENDSELECT
endsub
What I would like to be able to do next is open a MS Excel, Word, Powerpoint, or PDF document in a child window/dialog box. I can open an Excel file by just making it a menu selection and pointing to the file I want to open, but it opens in its own window and I have no control over it. I'd like to open the document in a separate window I can control.
Any insight would be greatly appreciated.
Logman
reading/writing 3rd party file formats isnt going to be as simple as you might think. You might need to download a 3rd party DLL that someone has created to automate this task, or convert some source code from c++ or vb or some other language.
I havent done any of this, but, a little bit of googling of "read/write excel" has turned up many results of code samples and 3rd party utilities.
I found a PDF that decribes the file format of Excel files, hopefully it might help out a bit.
http://sc.openoffice.org/excelfileformat.pdf
Good luck =)
Thanks for the input ZeroDog.
I thought what I would do first before I did any Dynamic Data Exchange between EBasic and Word or Excel is to first just bring up the document for viewing in a separate window that I create.
Once I can just bring it up for previewing, much like we do when we view PDF files, then I can dig into DDE/OLE/COM communication exchanges later on as I gain more experience with EBasic and COM/OLE etc.
Logman :)
just a thought here... alot of file types such as pdf can be displayed within a web browser control if the appropriate plugins are installed... you could try making the window a web browser control and point the browser control to the files and see what happens...
Hi Logman,
ZerDog is right; you can open PDF files by using the Ebasic browser control, if the browser is correctly configured.
BROWSECMD wpdf, @NAVIGATE,PDFFileName
This system works very well If you install a light PDF reader as FoxitReader.
bye
Sergio
Thanks ZeroDog and talun:
Couldn't get the -- BROWSECMD wpdf, @NAVIGATE,PDFFileName -- code working yet. However, I just went ahead and used -- SYSTEM GETSTARTPATH + "myWord.doc" -- and SYSTEM GETSTARTPATH + "myPDF.pdf" -- code to just bring up the respective documents for viewing. I'll get your code working over the weekend.
Next week I'm going to work on establishing API DDE/OLE connectivity from EBasic so users can enter information in an EBasic control and then have it passed into the respective documents including Excel and Powerpoint automatically. If I wasn't doing this for the folks at my office, I probably wouldn't even try tackling this stuff.
Logman ;D