View Single Post
 
Old 12-09-2016, 01:29 AM
Mike.Visio Mike.Visio is offline Windows 10 Office 2013
Novice
 
Join Date: Dec 2016
Posts: 1
Mike.Visio is on a distinguished road
Default Newbie need help with VBA Active.Window.page

Newbie need help with VBA Active.Window.page
Hello to all. I'm a newbie in Visio VBA. I use 2013. I created a document for a Network documentation. ("Documentation.vsd"). I made 3 new pages. ("Room1", "Room2", "Room3"). I Have also a "Start" Page
In the "ThisDocument" I created for "Document_BeforeDocumentSave" a Code how reset the Color for any shapes.

Here is my Question:

When I Close the document, my Code works fine, BUT: to Change the colour I use this for each page: (Room1,2,3) in one Code. Here for exampple for Room1:

Application.ActiveWindow.Page = Application.ActiveDocument.Pages.ItemU("Room1")
Application.ActiveWindow.ViewFit = visFitPage
Dim UndoScopeID1 As Long
UndoScopeID1 = Application.BeginUndoScope("Füllfarbe")
'VT06=ID23,VT13=ID26
Application.ActiveWindow.Page.Shapes.ItemFromID(23 ).CellsSRC(visSectionObject, visRowFill, visFillForegnd).FormulaU = "THEMEGUARD(RGB(238,172,72))"
Application.EndUndoScope UndoScopeID1, True
The Problem is, all the pages are just a second as active, and the changes makes a flicker, because the pages are changing for my Code from Room1 to Room2 and room 3.
Then I go back to the "Start" page.

My Question:

How can I let the Focus on the Start page and Change something (like colour) on another page, that isn't active? (Sorry for my broken english)

Thanks for all answers!
Reply With Quote