Quote Originally Posted by johndavidson View Post
The UF and its code are in a separate template (John.dot), which is loaded when Word is started. i.e. it lives in C:\Users\<username>\AppData\Roaming\Microsoft\Word\StartUp\John.dot.

The UF is initially associated with doc C, which happens to be the active document when the UF is opened. When the user indicates (by clicking a NEXT button on the UF) that work on doc C has been completed, then, by closing the UF, making B the active doc, and then (in the re-jigged routine) re-opening the UF, the UF is then associated with doc B. Likewise for doc C. This seems to get around the problems I was having.

It seems to me that UFs always begin life associated with the document that is active at the time the UF is opened, which is why, when you have multiple Word docs open at one time, a UF can disappear off screen or even get closed when the original doc is closed or when another doc is given the focus by clicking on it or from within VBA.

It would be good to know if there is a way to open a userform that is entirely unrelated to any particular Word document.
So, IF i'm understanding

1. John.dot has a UF and is in Word\StartUp

2. Word is NOT running yet

3. You start Word via command and File, Open C.doc -- OR -- just by double clicking C.doc

The UF will not display until something causes it to, either running a macro in John.dot or possibly an application event

What triggers the macro to get displayed?



However, I believe that just possibly 2003's Single Document Interface might have some thing to do with it.

Maybe C.doc is running Word in it's own window and showing the UF, B.doc is running in it's own window. That could explain

It seems to me that UFs always begin life associated with the document that is active at the time the UF is opened, which is why, when you have multiple Word docs open at one time, a UF can disappear off screen or even get closed when the original doc is closed or when another doc is given the focus by clicking on it or from within VBA.


The article has some things you can try


https://support.microsoft.com/en-us/...3-7f60b30ff49d


By default, versions of Word that are later than Microsoft Word 97 use the Single Document Interface (SDI) design, in which each document occupies its own window (just as in Microsoft Outlook each message occupies its own window). This behavior is different from Word 97 and earlier versions of Word, which use the Multiple Document Interface (MDI), in which each document is a separate window within the Word program window. SDI was introduced in Word 2000.