Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1863
  • Last Modified:

VBA on Visio 2013 - how to delete a range of pages

I would like to delete the first five pages in my visio file using VBA.
What is the code to do this?
0
brothertruffle880
Asked:
brothertruffle880
1 Solution
 
Scott HelmersVisio Consultant, Trainer, Author, and DeveloperCommented:
This will work by deleting "page 1" five times (each time you delete the page that is currently number 1, the next page becomes number 1).
Sub DeleteFirstFivePages()
    For i = 1 To 5
        ActiveDocument.Pages(1).Delete (False)
    Next
End Sub

Open in new window

0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now