Hmmm. What do you mean by dialog box? Are you calling one of Word's default
dialogs, or are you talking about a userform?
If a dialog, how are you calling it?
If a userform, how are you closing/unloading it? Please provide the calling
and closing code for either.
A dialog box in the sense of: I created a vb2005 windows form with an OK and
Cancel button. I display the form with: frm.ShowDialog(). I get the cannot
place focus back onto the document when the user closes the form via the
cmdCancel_Click() event where I have : frm.Close(). I also get the same
issue when the user simply clicks the "x" in the upper right corner of the
form/dialogbox. Thanks again for all your help!
> Hmmm. What do you mean by dialog box? Are you calling one of Word's default
> dialogs, or are you talking about a userform?
[quoted text clipped - 34 lines]
> > > > (without form.Close()). I thank you in advance for any information you can
> > > > offer!
zkid - 06 Oct 2006 20:34 GMT
Ah, okay, you need VB help. This is the VBA forum.
Anyway, I found this code on google by searching for VB activate application.
Link = http://www.developerfusion.co.uk/show/126/
//You can activate another application by using the AppActivate statement.
Simply provide the text in its titlebar:
//The shell function returns a TaskID (double), that you can use with the
AppActivate statement:
Private dblWordID As Double
'// runs word
Private Sub cmdRunWord_Click()
dblWordID = Shell("notepad", vbNormalFocus)
End Sub
'// activates word at a later stage
Private Sub cmdActivateWord_Click()
AppActivate dblWordID
End Sub
Here's another link to close a dialog box while hooking the user's
responses:
http://www.vbaccelerator.com/home/VB/Code/Libraries/Common_Dialogs/Hooked_Common
_Dialogs/article.asp
I think the problem is with the way your VB form closes. If none of the
above works, please try searching google for vb forums.
> A dialog box in the sense of: I created a vb2005 windows form with an OK and
> Cancel button. I display the form with: frm.ShowDialog(). I get the cannot
[quoted text clipped - 41 lines]
> > > > > (without form.Close()). I thank you in advance for any information you can
> > > > > offer!