Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2006

Tip: Looking for answers? Try searching our database.

macro effect on browse control button

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve Paul - 11 Feb 2006 03:52 GMT
I have created a macro that runs through the sections of a document and adds
a footer to each page.  A side effect has been that the "browse" control that
is located just below the vertical scroll bar changes from "previous page /
next page" to "previous section / next section".  This is a minor annoyance
for users since they can change it back again, but I am wondering if there is
any way to reset this programmatically to its default, since it does not
appear to be a customizable option that can be set anywhere in Word - tools -
options

thanks,

Signature

Steve Paul

Jay Freedman - 11 Feb 2006 04:32 GMT
>I have created a macro that runs through the sections of a document and adds
>a footer to each page.  A side effect has been that the "browse" control that
[quoted text clipped - 6 lines]
>
>thanks,

Yes, this line will reset the browser to previous/next page:

  Application.Browser.Target = wdBrowsePage

However, the fact that your macro changes the browser target in the
first place means that you're moving the Selection to the footer pane
of each section. That isn't a good way to work. Your macro would do
better to do something like

   Dim oSec As Section
   For Each oSec In ActiveDocument.Sections
       With oSec.Footers(wdHeaderFooterPrimary)
           .Range.Text = "my footer text"
       End With
   Next oSec

This can get fancier if necessary, but it'll be quicker and less
error-prone than dealing with the Selection.

--
Regards,
Jay Freedman
Microsoft Word MVP        FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
Steve Paul - 13 Feb 2006 16:06 GMT
Thank you - that is very helpful
Signature

Steve Paul

> >I have created a macro that runs through the sections of a document and adds
> >a footer to each page.  A side effect has been that the "browse" control that
[quoted text clipped - 32 lines]
> Email cannot be acknowledged; please post all follow-ups to the
> newsgroup so all may benefit.

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.