G
Gary''s Student
When starting an application like Word, how can I automatically select the
position and size of the window on the screen?
position and size of the window on the screen?
Gary''s Student said:When starting an application like Word, how can I automatically
select the position and size of the window on the screen?
Gary''s Student said:From without. I am launching Word and Outlook from a script rather
than double-clicking an icon. I have noticed that Windows
"remembers" the last position of an application after it is closed.
If I double-click and icon, the application usually launches in the
same screen area. There is probably an area in the registry that
contains this data. I am hoping there are some APIs available to
control it.
Gary''s Student said:Thank you for your help.
In the UNIX world, I would just set the xview parameters and proceed
Depending on what you mean by script, this might be much simpler thanFrom without. I am launching Word and Outlook from a script rather than
double-clicking an icon. I have noticed that Windows "remembers" the last
position of an application after it is closed. If I double-click and icon,
the application usually launches in the same screen area. There is probably
an area in the registry that contains this data. I am hoping there are some
APIs available to control it.
Tushar said:Depending on what you mean by script, this might be much simpler than
worrying about APIs or registry entries. If the script you refer to
is VBScript (or JScript), use something along the lines of
Option Explicit
Sub testWordPosition()
Dim x As Object
Const wdWindowStateNormal = 0
On Error Resume Next
Set x = GetObject(, "word.application")
On Error GoTo 0
If x Is Nothing Then Set x = CreateObject("word.application")
x.Visible = True
x.WindowState = wdWindowStateNormal
x.Left = 30
x.Top = 10
End Sub
Hi Karl,{snip}
{snip}
Yeah, I was thinking along similar lines ("from within"), but didn't ask as
clearly. Thanks for re-raising that possibility.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.