Excluding Page from a "For Each Page" loop

Started by Hamwic, November 10, 2015, 02:09:36 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Hamwic

I am needing to loop through each page sequentially, using a "For Each Page" loop, but need to exclude one (as it is irrelevant". Is there any way of doing this?

Thanks (as always) in advance!

Nikolay

I think this is pretty much straightforward... What have you tried so far (is there some issue)?

Paul Herber

#2
If vsoPage.Name = "xxx" then
...
else
...


{Ed} modified to suit your code posted just now
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

Hamwic

I'm sure it is pretty straight forward... The issue is that I don't know how to exclude a Page, as the loop will call each Page sequentially. They are not called directly by their name.

    For Each vsoPage In ThisDocument.Pages
        Application.ActiveWindow.Page = vsoPage

        For Each vsoShape In vsoPage.Shapes
            vsoUserName = vsoShape.CellsU("prop." & strFieldtoUpdate).ResultStr(visNone)
           
            intPropRow2 = vsoShape.AddRow(visSectionProp, visRowLast, visTagDefault)
            vsoShape.CellsSRC(visSectionProp, intPropRow2, visCustPropsValue).FormulaU = """" & vsoSuperUPN & """"
            Application.EndUndoScope UndoScopeID1, True
                   
        Next
    Next


I'm new to Visio and very rusty with VBA. This is a huge learning curve (again)!!

Hamwic

#4
Thanks Paul (again!).

Pretty obvious really... Just one of those situations where the trees are obscuring the wood!

Browser ID: smf (is_webkit)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 210 (show)
Files included: 32 - 1218KB. (show)
Memory used: 1083KB.
Tokens: post-login.
Cache hits: 11: 0.00160s for 26,572 bytes (show)
Cache misses: 1: (show)
Queries used: 15.

[Show Queries]