Re: HTML Printer in a new window


[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]

Posted by Jim Guerber on January 31, 2008 at 12:51:19:

In Reply to: Re: HTML Printer in a new window posted by Mike Saunders on January 30, 2008 at 11:08:11:

I have been looking into this for several hours now. Now, don't get me wrong; I am not an expert, but here is what I found.

1. See the MS article referenced below for a discussion of how Windows launches the default browser.

2. You can use the launch mnemonic, or ShellExecute mnemonic from LUN 0, From a background program you can only use the ShellExcecute mnemonic to the system gateway.

3. If you use launch or shellExecute on lun 0, you should input the result string even if you do not wish to examine it.

4. If you launch the document, not the program, you will get multiple documents in the same window.

5. That pause between launches seems to be important. Maybe it gives Windows a chance to find the application. Without it, especially using Firefox as the default browser, gives "mixed" results.

6. To launch a new window for each document, do the shell execute of the executable, passing the path as an argument to it.

7. Firefox does not like DDE for some reason. Try editing the open action for the HTML file type and unchecking "Use DDE".

Here is my test program. Try changing the comments and see what results you get. With this limited testing, it seems that IE7 is more consistent than Firefox.

length 80 & local a$ path$
print (et)
path$ = 'd:\comet\COS\HTML1.HTM'
Gosub Launchit
pause(18) ! this makes a difference
path$ = 'd:\comet\COS\HTML2.HTM'
Gosub Launchit
stop

LaunchIt:
!Print (0) (Launch=path$)
!Print (0) (ShellExecute="open",path$,"","",1)
!Print (0) (ShellExecute="","iexplore",path$,"",1)
Print (0) (ShellExecute="","C:\Program Files\Mozilla Firefox\firefox.exe",path$,"",1)
input a$ ! need to input result string for lun 0 activity

!Close (20)
!Open (20) "X00"
!Print (20) (ShellExecute="Open",path$,"","",1) ! opens default browser in a single window
!Print (20) (ShellExecute="","iexplore",path$,"",1) ! opens each in a new window
!Close (20)
Rtn: Return




Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

What is the name of the main Signature System's Product?

Comments:

Optional Link URL:
Link Title:
Optional Image URL:

You may attach up to 5 files to your followup (see below):





Each file can be a maximum of 1MB in length Uploaded files will be purged from the server on a regular basis.


[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]