Re: Moving between open Word documents
- From: Jay Freedman <jay.freedman@xxxxxxxxxxx>
- Date: Sat, 18 Jun 2005 12:03:47 -0400
Hi Chigongman,
Since you're a total novice, you'll need a little more assistance than
even the article Suzanne cited.
In step 1 of the article, it assumes that the code you were given
includes the name of the macro, but the code Doug posted doesn't
contain that detail. What may not be clear is that you can choose
pretty much any name you want, as long as it contains only letters,
digits, and underscores (no spaces or other punctuation). As a novice
you should also avoid using macro names that duplicate Word's built-in
commands -- although that can be a useful technique when you know what
you're doing -- and a good way to be sure of that is to include your
initials in the macro name.
So, let's say you choose the name CMWindowForward for Doug's code. In
the Tools > Macro > Macros dialog, type that into the Macro Name box
and click Create, then paste Doug's code between the lines that Word
creates for you in the macro editor, as described in the article.
For a second macro that cycles backward, the code is similar, but it
needs to deal with the "boundary condition" (going from the first
window to the last window) differently. It would look like this:
Sub CMWindowBackward
Dim i As Long
i = ActiveWindow.Index
If i > 1 Then
Windows(i - 1).Activate
Else
Windows(Windows.Count).Activate
End If
End Sub
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
On Sat, 18 Jun 2005 00:13:30 -0500, "Suzanne S. Barnhill"
<sbarnhill@xxxxxxxx> wrote:
>See http://www.gmayor.com/installing_macro.htm
>
>--
>Suzanne S. Barnhill
>Microsoft MVP (Word)
>Words into Type
>Fairhope, Alabama USA
>Word MVP FAQ site: http://word.mvps.org
>Email cannot be acknowledged; please post all follow-ups to the newsgroup so
>all may benefit.
>
>"Chigongman" <Chigongman@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>news:37F6849A-C1E0-4D0B-A92A-7498AD52282A@xxxxxxxxxxxxxxxx
>> Wow. That's interesting.
>>
>> I'm a total novice when you say "code" and I can only imagine that I'd
>copy
>> and paste your post into the text area for editing/creating a macro, I
>> presume. Assuming that's the case, would you pleae be so kind as to tell
>me
>> where and how so I don't risk messing up my Normal.dot file or something
>else
>> expermimenting?
>>
>> Also, I assume this will move "forward" to the next window (or nowhere if
>> there is no other Word document open). Can I assume that changing +1 to -1
>> will do the same but cycle "backward" and thus allow me to have two
>keyboard
>> commands to go either to the "Next" or "Previous" window?
>>
>> Thanks a million.
>>
>> Jay
>>
>>
>> "Doug Robbins" wrote:
>>
>> > The following code will cycle through the active documents:
>> >
>> > Dim i As Long
>> > i = ActiveWindow.Index
>> > If i < Windows.Count Then
>> > Windows(i + 1).Activate
>> > Else
>> > Windows(1).Activate
>> > End If
>> >
>> >
>> > --
>> > Hope this helps.
>> >
>> > Please reply to the newsgroup unless you wish to avail yourself of my
>> > services on a paid consulting basis.
>> >
>> > Doug Robbins - Word MVP
>> > "Chigongman" <Chigongman@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> > news:9D95DBC9-25F9-41AA-A6B3-BB0D4E73732F@xxxxxxxxxxxxxxxx
>> > > When I had Word 2000 on my W98 machine I created macros that let me
>use
>> > > Function buttons on the keyboard (F11, F12), to move to the Previous
>or
>> > > Next
>> > > open Word document. It was a very convenient way of cycling through
>> > > multiple
>> > > open documents.
>> > >
>> > > Now I'm using Word 2003 (Office 2003) on an XP machine and I can't
>seem to
>> > > find how to do that. Ican't find how to move between documents --
>other
>> > > than
>> > > the basic method of "Window - #" which won't work for a macro for
>> > > cycling --
>> > > which means I of course also don't know how to create a macro for it.
>> > >
>> > > Searching Help didn't yield anything useful at all. (I'm wondering if
>the
>> > > commands are even available in 2003.)
>> > >
>> > > Thanks.
>> > >
>> > >
>> >
>> >
>> >
.
- References:
- Moving between open Word documents
- From: Chigongman
- Re: Moving between open Word documents
- From: Doug Robbins
- Re: Moving between open Word documents
- From: Chigongman
- Re: Moving between open Word documents
- From: Suzanne S. Barnhill
- Moving between open Word documents
- Prev by Date: Re: Moving between open Word documents
- Next by Date: Re: Toolbar gone
- Previous by thread: Re: Moving between open Word documents
- Next by thread: menu bar
- Index(es):