R
RedDirt
I am fairly new to VBA - I apologize for the naive question. I've created a
macro in word that opens a userform and minimizes Word. The problem is that
when Word minimizes, the userform is no longer the focus and "falls" behind
any other open windows.
How do I minimize Word and place the focus on the form I just opened? Below
is the code in Word I'm using.
Sub Procedure()
Load UserForm
For Each myTask In Tasks
If InStr(myTask.Name, "Microsoft Word") > 0 Then
myTask.Activate
myTask.WindowState = wdWindowStateMinimize
End If
Next myTask
UserForm.Show
End Sub
In the ideal world I would prefer to have a stand alone application and
never open Word, or if it opens, minimize/hide it immediately. All the
functionality is built into the form. When I have the time to dedicate to
it, I will migrate the code to VB. Does anyone have any tips to minimize the
visibility of Word in this scenario? (No pun intended).
Thanks,
John
macro in word that opens a userform and minimizes Word. The problem is that
when Word minimizes, the userform is no longer the focus and "falls" behind
any other open windows.
How do I minimize Word and place the focus on the form I just opened? Below
is the code in Word I'm using.
Sub Procedure()
Load UserForm
For Each myTask In Tasks
If InStr(myTask.Name, "Microsoft Word") > 0 Then
myTask.Activate
myTask.WindowState = wdWindowStateMinimize
End If
Next myTask
UserForm.Show
End Sub
In the ideal world I would prefer to have a stand alone application and
never open Word, or if it opens, minimize/hide it immediately. All the
functionality is built into the form. When I have the time to dedicate to
it, I will migrate the code to VB. Does anyone have any tips to minimize the
visibility of Word in this scenario? (No pun intended).
Thanks,
John