PDA

View Full Version : Need help with File Open, Print



nim
03-07-2003, 01:21 PM
I'm redoing this post cause it was meant as a question, so i used the question icon...lol. Here it is again:

I need help with the proper command for "File open", i.e. to open .htm and .html files, and also the print command so that it will properly print a page viewed... I'm a newbie, so please help if u can. Thanx.

Worm
03-07-2003, 01:32 PM
To open a htm file in the default browser use the file open action.

File.Execute ("%SrcDir%\Test.htm", "", Continue)

I'm not sure you can ge thhe default browser to print from AMS.

=================
To open a HTM file in the web object:
WebBrowserObject[WebBrowser1].NavigateTo ("http://www.indigorose.com")


To Print:
WebBrowserObject[WebBrowser1].Print

Worm
03-07-2003, 01:42 PM
Just remembered a post a while back from Lorne. If the HTM file is local and it is open in an external browser you may be able to do a File.Open with a print verb to get it to print.

nim
03-07-2003, 02:09 PM
It will be local .htm files i will want to open from a browser i made with ams... ex. i will want to open folder c:\my documents\my htm files\*.htm... could u please give me the proper command lango... ? Appreciate it much ;-).

Worm
03-07-2003, 02:13 PM
Drop a Browser object on a page, the put this action in a click event.

WebBrowserObject[WebBrowser1].NavigateTo ("file://C:/your/path/here/your.htm")

nim
03-07-2003, 02:22 PM
Please don't laugh... I have created a little document browser, and set it to open a local web page at startup that i have on my hard drive... but i then created a text object that says "File"... what i want is, when File text object is click, the directory i specify will open, from where i can choose a page, and it will then display that page... directory will be c:\My Documents\My HTM Files\*.htm ... can u help? lol

Worm
03-07-2003, 02:34 PM
Here is a sample. (http://www.warmuskerken.com/ams/nim.zip)

nim
03-07-2003, 02:54 PM
It will open the files ok, but before it opens the folder, it returns this error: "Could not Load Dll" and lists the path. Is this merely because I must have exact path of files location entered? Darn us newbies got so much to learn...lol

Worm
03-07-2003, 03:07 PM
Check your distribution folder and make sure there is a file there named GetFolders.dll

If it is there and you are still getting the error, modify the click event to be this
%FullPath% = Dialog.FileBrowse (Open, "File Open", "%Desktop%", "HTML (*.htm, *.html)|*.htm|*.html")
WebBrowserObject[WebBrowser1].NavigateTo ("%FullPath%")

nim
03-07-2003, 03:22 PM
Sorry to make this such a long drawn out thing, there is no GetFolders.dll under distribution, where do i get such a file?

nim
03-07-2003, 04:15 PM
Got the GetFolders.dll afterall, but i'm still getting the "Could not load dll" error before it will permit me to open an .htm page...

Worm
03-07-2003, 06:49 PM
What OS are you running? What version of IE?

The DLL is one that I wrote to get the My Documents directoy. If putting in the static address path works, do that.

nim
03-11-2003, 02:18 AM
Worm: a funny thing happend, i figured how to file open without using the dll, however it worked fine in win xp and cause error in win98... so i went back to figuring out how to use the GetFolders.dll that you sent me. I think I got it working now... just had to move GetFolders.dll into distribution folder for whatever cause.

Worm
03-11-2003, 05:21 AM
exactly! I must have missed that when I zipped it up.

Have Fun!

Worm
03-11-2003, 06:29 AM
The reason for the DLL is that the My Documents folder may not be where you expect it to be. Using the DLL, you'll be able to define where the user has their My Documents folder.

Probably not too many people would change the location. At my place of employment, it is the company standard to change it to a location on the servers so that a users documents are backed-up.