SaintBernard Posted November 28, 2014 Share Posted November 28, 2014 If WinExists("Word") Then Sleep (3000) MsgBox(0,"Word","Does Exist") Sleep (3000) WinActivate ("Word") Sleep (3000) WinMove("Word", 5, 5, 800, 560, 90) Else Sleep (3000) MsgBox(0,"Word","Does Not Exist") EndIf Can anyone please tell me why the 'WinMove' statement in the code above does not work? The message box displaying 'Does Exist' does appear. I am running Windows 7 Professional 64. Thank You! Link to comment Share on other sites More sharing options...
Developers Jos Posted November 28, 2014 Developers Share Posted November 28, 2014 You are missing the second parameter in WinMove() Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Solution SaintBernard Posted November 30, 2014 Author Solution Share Posted November 30, 2014 I figured it out! Here is my script: ; ; Resize Word ; ; Resets 'Microsoft Word' to its Default Size ; #include <MsgBoxConstants.au3> AutoItSetOption ("MustDeclareVars",1) AutoItSetOption ("WinTitleMatchMode",2) Global Const $sz_Window_Name = "Microsoft Word" Global Const $n_X_Coord = 0, $n_Y_Coord = 1, $nWidth = 800, $nHeight = 560 Global $n_Window_X_Y_Width_Height [4] If WinExists ($sz_Window_Name) Then Sleep (1000) $n_Window_X_Y_Width_Height = WinGetPos ($sz_Window_Name) Sleep (1000) WinMove ($sz_Window_Name,"",$n_Window_X_Y_Width_Height [$n_X_Coord],$n_Window_X_Y_Width_Height [$n_Y_Coord],$nWidth,$nHeight) Else Sleep (1000) MsgBox ($MB_ICONERROR + $MB_OK,"Resize Word","Error: Unable to Locate an Instance of 'Microsoft Word' on the Desktop.") EndIf 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