Sly01 Posted July 10 Share Posted July 10 So I'm trying to get rid of that stupid Navigation bar on the side of word... It's not something needed but as I am getting better with AutoIT I would love to understand how I could do it. There is no ID in the Control.... And the number at the end of the class may change if it comes back later on... Would I have a way to run through each of them until I find the Navigation one and then click on the X? Link to comment Share on other sites More sharing options...
water Posted July 10 Share Posted July 10 If you use the Word UDF that comes with AutoIt then this should work (untested): #include <Word.au3> $oWord = _Word_Create() $oWord.ActiveDocument.ActiveWindow.DocumentMap = False My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Sly01 Posted July 10 Author Share Posted July 10 49 minutes ago, water said: If you use the Word UDF that comes with AutoIt then this should work (untested): #include <Word.au3> $oWord = _Word_Create() $oWord.ActiveDocument.ActiveWindow.DocumentMap = False Unfortunately, it's not the script that opens that window... There is a constant process. that processes documents and open Word to render them in TIF files. So I don't think that would work That's why I really need a way to close that window pane... Link to comment Share on other sites More sharing options...
Andreik Posted July 10 Share Posted July 10 17 minutes ago, Sly01 said: Unfortunately, it's not the script that opens that window Even so you might use _Word_DocAttach(). When the words fail... music speaks. Link to comment Share on other sites More sharing options...
rsn Posted July 10 Share Posted July 10 (edited) The check box to control the Navigation Pane is under View -> Show. I suspect UIA should be able to find and flip that checkbox. You can also control it via the registry though you'll have to restart Word to see the changes. HKCU\SOFTWARE\Microsoft\Office\16.0\Word\Data\Toolbars REG_BINARY has a lot data there. The location to flip it on or off is 000000AF. Setting it to 00 is off and 02 is on. Coding those is outside of my time constraints at the moment but hopefully that'll get you started. Edited July 10 by rsn Link to comment Share on other sites More sharing options...
ioa747 Posted July 10 Share Posted July 10 #include <WindowsConstants.au3> #include <SendMessage.au3> $hWndWord = WinGetHandle("[CLASS:OpusApp]") ConsoleWrite("$hWndWord=" & $hWndWord & @CRLF) $hNavigation = ControlGetHandle($hWndWord, "", "[CLASS:MsoCommandBar; TEXT:Navigation]") ConsoleWrite("$hNavigation=" & $hNavigation & @CRLF) _SendMessage($hNavigation, $WM_CLOSE) rsn 1 I know that I know nothing Link to comment Share on other sites More sharing options...
Sly01 Posted July 11 Author Share Posted July 11 12 hours ago, ioa747 said: #include <WindowsConstants.au3> #include <SendMessage.au3> $hWndWord = WinGetHandle("[CLASS:OpusApp]") ConsoleWrite("$hWndWord=" & $hWndWord & @CRLF) $hNavigation = ControlGetHandle($hWndWord, "", "[CLASS:MsoCommandBar; TEXT:Navigation]") ConsoleWrite("$hNavigation=" & $hNavigation & @CRLF) _SendMessage($hNavigation, $WM_CLOSE) Genius!!! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now