Jump to content

Recommended Posts

Posted

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?

Posted

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!

Posted

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  

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
×
×
  • Create New...