FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   Add to FavoritesAdd to Favorites  * Code Snippets
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    RSS Get RSS Feed  


Function to Print the Contents of a Dialog

 
Post new topic   Reply to topic    Macro Scheduler and Windows Automation Forum Index -> Enhancement Suggestions
View previous topic :: View next topic  
Author Message
JRL
Automation Wizard


Joined: 10 Jan 2005
Posts: 2650
Location: Iowa
Reputation: 993.5
votes: 91

PostPosted: Wed Aug 31, 2011 1:59 am    Post subject: Function to Print the Contents of a Dialog Reply with quote

This was discussed a year ago HERE but things sometimes get overlooked if they're not in the proper place.

Is there any chance of getting a built in print function that could print the contents of the working area of a dialog and provide a few controls for size, location and orientation for example? Or just as good, is there any way to use a library function or vbscript to print a dialog. The problem I have with the methods described in the above mentioned thread are that there are no controls for even simple choices such as portrait vs landscape.
_________________
A few homemade utilities

Did this message help you? If so please reward the poster with Reputation Points? Reward Points
Back to top
View user's profile Send private message
JRL
Automation Wizard


Joined: 10 Jan 2005
Posts: 2650
Location: Iowa
Reputation: 993.5
votes: 91

PostPosted: Fri May 18, 2012 6:07 am    Post subject: Reply with quote

Here is a concept using HTA. Still not perfect but provides the standard windows print dialog box so that some controls are available such as portrait vs landscape and number of copies.

The "Print" subroutine should be usable as-is for most dialog boxes. You just need to put a print button in your dialog then set up a dialog handler to call the "Print" subroutine when the print button is selected. The dialog handler needs to have three parameters. The name of the dialog being printed, the name of the print button (or any other object you might choose to use). The third and last parameter is an optional "1" if you want the print process to autocomplete printing to the default printer rather than displaying the standard windows print dialog.

You will probably find that there is header and footer information printing along with the dialog. The header and footer are from Internet Explorer. hta is tied to IE and you can control the header and footer contents via Internet Explorer > File > Page Setup...

Hope this makes sense and that someone finds it useful.


_________________
A few homemade utilities

Did this message help you? If so please reward the poster with Reputation Points? Reward Points
Back to top
View user's profile Send private message
Display posts from previous:    View previous topic :: View next topic  
Post new topic   Reply to topic    Macro Scheduler and Windows Automation Forum Index -> Enhancement Suggestions All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group