PDA

View Full Version : Word Userform hiding behind document



Jordan427
09-26-2014, 02:07 AM
Hi All,

I really need some help here.

Basically I have a macro which opens up a word document to split into single pages and apply some formatting (adding logo, setting margins etc etc), there's a userform which should appear after the contents have been pasted to the new document to allow the user to then accept, reject or edit that current letter. If they accept it it then saves, if they reject it, it then skips to the next one and if they wish to edit it it just saves it for when the whole process is finished they can then edit it.

This all works fine, apart from SOMETIMES the userform doesn't show ontop of the new document, instead it hides behind one of the older ones. I really can't figure out what to do, and it seems to be completely random.

Any help on this would be greatly appreciated!
Thanks

Jordan427
09-26-2014, 02:16 AM
I should add, I don't think modality can help me and I've tried using 'pauses' just before the userform shows and I've tried minimising certain docs and maximising the current doc but it doesn't seem to help

snb
09-26-2014, 02:17 AM
Only use one userform ever.

Jordan427
09-26-2014, 02:21 AM
I am doing, the problem is it isn't showing on top of the document I need it to

snb
09-26-2014, 03:56 AM
Hiding the application should: application.visible=false

or


Private Sub UserForm_Initialize()
ActiveDocument.Windows(1).WindowState = 2
End Sub