Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2006

Tip: Looking for answers? Try searching our database.

VBA Word 2000 - make form stay on top of everything

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark - 25 Sep 2006 23:51 GMT
I've seen posts on this topic, but none of them satisfy what I'm trying
to do.  Does anyone know of a way to make a form stay on top of all
applications or even on top of all open Word documents?  I want a form
that stays on top even if I minimize its parent Window (the document
from which it was launched).  I want it to stay on top even if I click
on another Word document.  Is it possible?

I've used the SetWindowPos function, but as soon as I minimize the
form's parent, the form minimizes as well.  I've tried using the
SetParent function and the GetDesktopWindow function to make the
desktop the forms parent, but for some reason the GetDesktopWindow
seemed to return the same handle as the form's parent Word document.

Any help would be greatly appreciated.
Mark - 28 Sep 2006 16:26 GMT
OK, for clarification, I found the EXACT functionality I want to try to
replicate.  It still have not found a good solution.  It must be
possible because Word does it (somehow).  I want to replicate the
functionality of the Cross-reference dialog:

In Word (I know this works in 2000 and 20003):

- From the Insert menu, select Reference and then Cross-reference
- Open another Word document
- Click on the older document, then the newer, then the dialog

Notice how the dialog stays on top of all Word documents, and doesn't
bring its original parent to the front when you drag it around, and
doesn't disappear when you minimize one of the documents.  You can even
kill its original parent and it won't go away.

I figure there's got to be a way to do this since it's built into
Word!!

Any ideas?  Thanks!

> I've seen posts on this topic, but none of them satisfy what I'm trying
> to do.  Does anyone know of a way to make a form stay on top of all
[quoted text clipped - 10 lines]
>
> Any help would be greatly appreciated.
Russ - 28 Sep 2006 18:18 GMT
Mark,

> OK, for clarification, I found the EXACT functionality I want to try to
> replicate.  It still have not found a good solution.  It must be
[quoted text clipped - 14 lines]
> I figure there's got to be a way to do this since it's built into
> Word!!
Or it's Word making specific calls to the operating system's windowing
functions. That doesn't necessarily mean Word provides the VBA functions to
do what you want through VBA. Unless you also address the correct windowing
functions through VBA code yourself by calling the operating system's
windowing functions. ( I don't know what they are. ) Modeless forms is the
closest Word seems to come to that type of window and modeless forms don't
work with all versions of Word.

> Any ideas?  Thanks!
>
[quoted text clipped - 12 lines]
>>
>> Any help would be greatly appreciated.

Signature

Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID

Mark - 02 Oct 2006 16:56 GMT
Good point Russ.  Maybe just because you see it in Word doesn't mean
that you can easily do it in VBA.  I have found a list of win32 lib
Windowing calls:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/win
dowsuserinterface/windowing/windows/windowreference/windowfunctions/setparent.as
p


I've tried SetWindowPos, BringWindowToTop, and SetForegroundWindow,
they all seemed to set the z-order for the Form temporarily - until
another Word doc was activated and brought on top of the form.  I also
tried setting the form's parent to other things including the desktop -
(GetDesktopWindow didn't work for some reason).  It seems like what I
want to do is set the form as a child of the application - not just a
single document, but with the SDI design, I'm not sure how to do that.
Hmmmmm.... any ideas?

Thanks again,
Mark

> Mark,
>
[quoted text clipped - 40 lines]
> >>
> >> Any help would be greatly appreciated.
Russ - 02 Oct 2006 17:55 GMT
Mark,
I'm out of my element using system calls, but I've noticed people using
shell32.dll and wscript calls. Maybe these links will lead to the info you
require.
Google Groups Word search using shell32.dll
http://tinyurl.com/gmmjx
Google Groups Word search using wscript
http://tinyurl.com/jfsgy

> Good point Russ.  Maybe just because you see it in Word doesn't mean
> that you can easily do it in VBA.  I have found a list of win32 lib
[quoted text clipped - 60 lines]
>>>>
>>>> Any help would be greatly appreciated.

Signature

Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.