View Single Post
 
Old 04-01-2011, 03:11 PM
macropod's Avatar
macropod macropod is online now Windows 7 32bit Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi SaneMan,

Without seeing your code, it's hard to say exactly what the issues are. I would have thought that, if you correctly substituted 'ThisDocument' or the 'DocFrm' calls for 'ActiveDocument', everything would have worked the same as it did before. In my testing with the original code, the only thing that causes the DocFrm document to re-appear of its own accord is maximising another document you might have opened over it, then closing that document.

As for:
Quote:
using this code stops the letters from appearing in a new document as I assume they are not visible along with the DocFrm
I have no trouble opening, displaying & editing another document whilst the one containing the userform (which I'm running in modeless state) is hidden and the useform is visible.

Equally, it shouldn't be necessary to have the document visible to update it through code (eg I have some test code to update bookmarks in the document and it works fine when the document's not visible). I do accept though that, if you hide a userform attached to an invisible document, regaining access to the userform would be problematic - you'd need the 'hide' code to activate another small form with a button to restore the original one.

Finally, regarding:
Quote:
Is there a way of creating a maco so that when you activate the the word document (by clicking it from the task bar once the form is minimized) it automatically shows the form?
I imagine you could create a class module and use the 'Public WithEvents wdApp As Word.Application' declaration to give you access to the Window Activation, etc events, but I have no experience with coding for those events.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote