1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

How to make Visual Basic Macro only make changes to certain pages

Discussion in 'Business Applications' started by menander, Jan 7, 2013.

Thread Status:
Not open for further replies.
  1. menander

    menander Thread Starter

    Joined:
    Jan 21, 2012
    Messages:
    15
    Hi,

    I have several macros I've written for Word VB, which all work fine. But I would like to make them only affect all pages after page 3 in my documents, so that these first three pages are never affected by all the operations carried out in the macros. So, I want Word to only look at pages 4 up to the document's last page(this number varies). How can I do this be, please?

    Thanks,
    Kay
     
  2. draceplace

    draceplace

    Joined:
    Jun 8, 2001
    Messages:
    2,583
    The current page number is :
    Pagnr = Selection.Information(wdActiveEndPageNumber)

    Total number of pages:
    TotPages = ThisDocument.ComputeStatistics(wdStatisticPages)

    I'm not a word vba'er so I can't be much help past that. The next question would be how to GoTo that page? If you can GoTo nextpage until you get to 4 but you could also loop count and get there? Maybe others can provide better info, this might be enough info to 'Google' intellegently.
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1084107

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice