I am trying to control the window location of Word.
My WinForms (C#) application takes up the bottom half of the screen and launches an instance of Word. I need this instance to take the upper half of the screen.
This cannot be controlled through interop so I managed to to get the Window Handle of the Word instance. Then I tried using SetWindowPos, SetWindowsLong, etc. in various ways but without any visible results.
Instead of posting buggy code all over again, I wanted a fresh start so any suggestions are welcome from people who have achieved something like this.
You can use Application.Move method. or set Application.Top or Application.Left properties directly. your code can be like this:
dont forget to add Microsoft Word Object Library to your references and using related namespace: