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,

--
Steve Paul

Re: macro effect on browse control button by Jay

Jay
Fri Feb 10 22:32:40 CST 2006

On Fri, 10 Feb 2006 19:52:27 -0800, "Steve Paul"
<StevePaul@discussions.microsoft.com> wrote:

>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,

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.

Re: macro effect on browse control button by StevePaul

StevePaul
Mon Feb 13 10:06:28 CST 2006

Thank you - that is very helpful
--
Steve Paul


"Jay Freedman" wrote:

> On Fri, 10 Feb 2006 19:52:27 -0800, "Steve Paul"
> <StevePaul@discussions.microsoft.com> wrote:
>
> >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,
>
> 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.
>