>>>>>>>>>>>>> Both arguments are string values for FindWindow(). If you don't want to
>>>>>>>>>>>>> supply a caption or class name you would use "" as the argument. In this
>>>>>>>>>>>>> case for a UserForm you would use this:
>>>>>>>>>>>>>
>>>>>>>>>>>>> className = "ThunderDFrame"
>>>>>>>>>>>>> caption = "form caption, whatever it is"
>>>>>>>>>>>>>
>>>>>>>>>>>>> I made a quickie user form with a caption of "Foobar" so my call would be:
>>>>>>>>>>>>>
>>>>>>>>>>>>> caption = "Foobar"
>>>>>>>>>>>>> hWnd = FindWindow(className, caption)
>>>>>>>>>>>>>
>>>>>>>>>>>>> or for a null for the class name:
>>>>>>>>>>>>>
>>>>>>>>>>>>> hWnd = FindWindow("", caption)
>>>>>>>>>>>>>
>>>>>>>>>>>>> I got className = "ThunderDFrame" by displaying the user form and then
>>>>>>>>>>>>> looking at the open windows in Spy++.
>>>>>>>>>>>>>
>>>>>>>>>>>>> However, one problem with this is that userForm.Show() displays the user
>>>>>>>>>>>>> form modally by default so any code after that Show() line wouldn't execute
>>>>>>>>>>>>> until the user form was closed unless you explicitly show the form
>>>>>>>>>>>>> non-modally. So the call would have to be:
>>>>>>>>>>>>> userForm.Show vbModeless
>>>>>>>>>>>>>
>>>>>>>>>>>>> Then your FindWindow() code would be called when the window (user form) is
>>>>>>>>>>>>> still open. Of course then you have to do something to let the form work and
>>>>>>>>>>>>> stop continued execution of your code until the form is closed, something
>>>>>>>>>>>>> like a loop looking for a global Boolean flag that's set by the form when
>>>>>>>>>>>>> it's closing and is cleared by your calling code just before the form is
>>>>>>>>>>>>> opened.
>>>>>>>>>>>>>
>>>>>>>>>>>>> I'm not sure why you'd want to call ShowWindow with an argument of SW_SHOW
>>>>>>>>>>>>> after having already opened the window with UserForm.Show? Is there a
>>>>>>>>>>>>> specific reason for that?
>>>>>>>>>>>>>
>>>>>>>>>>>>> --
>>>>>>>>>>>>> Ken Slovak
>>>>>>>>>>>>> [MVP - Outlook]
>>>>>>>>>>>>>
http://www.slovaktech.com
>>>>>>>>>>>>> Author: Professional Programming Outlook 2007
>>>>>>>>>>>>> Reminder Manager, Extended Reminders, Attachment Options
>>>>>>>>>>>>>
http://www.slovaktech.com/products.htm
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> "Robin" <Robin@discussions.microsoft.com> wrote in message
>>>>>>>>>>>>> news:45B08195-D332-47F3-81D7-7CE531E7259A@microsoft.com...