Forum Discussion
KlaCat
Sep 16, 2023Copper Contributor
VBA code to bring the active document in front
I have a subroutine that produces and edits six different documents. My current problem is that the documents all stay in the background. But, I want them to be in front of all other windows using o...
Charles_Kenyon
Sep 16, 2023Bronze Contributor
I do not know that this will do what you want but you can get the count of open documents and activate one by the activate command. For example:
Documents(4).Activate
That should move document 4 to the top.
Question: Are you trying to animate Word? PowerPoint is far better for this and you do not need vba to do it. If in Word, you would want to be moving objects/images to the top in the document, not entire documents.
KlaCat
Sep 16, 2023Copper Contributor
I could probably just do
ActiveDocument.Activate
but what's the difference between doing that and
ActiveDocument.Visible = True
?
- Stefan_BlomSep 16, 2023MVP
The Window.Visible property determines if a document window is visible in the user interface or not (see https://learn.microsoft.com/en-us/office/vba/api/word.window.visible). It doesn't have anything to do with activating Word windows.