Sign in to follow this  
Followers 0
gjenkins

Problem Working with MSOffice Print Dialogues

4 posts in this topic

Using the AuotIt Window Info tool, I can not get much information about the controls in the Microsoft Office Print Dialogs/Windows (File -> Print). The tool will identify the window name "Print" and the class (Word = bosa_sdm_Mocrosoft Office Word, Excel = bosa_SDM_XL9). I can not get any information about the controls.

Is there a way to get this information and work with these windows?

Share this post


Link to post
Share on other sites



Office doesn't use standard controls, so it's hard to automate using controlclick, etc.

However the "Word.au3" UDF contains a _WordDocPrint function

Share this post


Link to post
Share on other sites

Office doesn't use standard controls, so it's hard to automate using controlclick, etc.

However the "Word.au3" UDF contains a _WordDocPrint function

Thanks T!

I was reading, and came across a few sentences that explained the possible standard control problem. Unfortuantely, I am trying to develop a solution that spans across multiple applications, so the Word functions don't help. Well, they help if I were to develop similar functions for all supported applications. Ack!

Share this post


Link to post
Share on other sites

Here an Example for Word and Excel:

; in WinWord
#include <Word.au3>
$path = 'your *.doc path'
$oWord = _WordCreate($path)
_WordDocPrint($oWord)
_WordQuit($oWord)


; in Excel
#include <Excel.au3>
$path = 'your *.xls path'
$oExcel = _ExcelBookOpen($path)
; if several sheets activate that you want (name or number of sheet):
$oSheet = $oExcel.Worksheets.Item(1)
; select print range
$oSheet.PageSetup.PrintArea = 'A1:D8'
$oSheet.PrintOut

Best Regards BugFix  

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0