Synchronise horizontal scroll of table in split screen

  • Thread starter Charles Harrison
  • Start date
C

Charles Harrison

MS Word 2003.
I have my column headings in the top row of my table & have split the screen
so that I can add text to the other rows, whilst still being able to view the
headings. I'd like to be able to scroll holizontally so that the headings
remain aligned to the cells below them.
 
S

Stefan Blom

As far as I know, there is no way to control the scrolling the way you
described it. But note that you don't have to split the screen to view
your heading row. Instead, you could just select the top row of the
table and, on the Table menu, click Heading Rows Repeat. That way,
you'll see it on all pages occupied by the table.

--
Stefan Blom
Microsoft Word MVP


in message
news:[email protected]...
 
J

Jean-Guy Marcil

Charles Harrison was telling us:
Charles Harrison nous racontait que :
MS Word 2003.
I have my column headings in the top row of my table & have split the
screen so that I can add text to the other rows, whilst still being
able to view the headings. I'd like to be able to scroll holizontally
so that the headings remain aligned to the cells below them.

Try this code:

'_______________________________________
Sub ActivateKeysUpDown()

CustomizationContext = ActiveDocument.AttachedTemplate

KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyEnd), _
KeyCategory:=wdKeyCategoryMacro, _
Command:="GoLeft"

KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyHome), _
KeyCategory:=wdKeyCategoryMacro, _
Command:="GoRight"

End Sub
'_______________________________________

'_______________________________________
Sub GoRight()

Dim Doc1 As Pane
Dim Doc1Index As Long
Dim Doc2 As Pane
Dim Doc2Index As Long

With ActiveDocument.Windows(1)
If .Panes.Count = 2 Then

Set Doc1 = .ActivePane
Doc1Index = .ActivePane.Index
If Doc1Index = 1 Then
Doc2Index = 2
Else
Doc2Index = 1
End If
Set Doc2 = .Panes(Doc2Index)

Doc2.Activate
Doc2.SmallScroll ToLeft:=5
Doc1.Activate
Doc1.SmallScroll ToLeft:=5

Set Doc1 = Nothing
Set Doc2 = Nothing

Else

.ActivePane.SmallScroll ToLeft:=5

End If
End With

End Sub
'_______________________________________

'_______________________________________
Sub GoLeft()

Dim Doc1 As Pane
Dim Doc1Index As Long
Dim Doc2 As Pane
Dim Doc2Index As Long

With ActiveDocument.Windows(1)
If .Panes.Count = 2 Then

Set Doc1 = .ActivePane
Doc1Index = .ActivePane.Index
If Doc1Index = 1 Then
Doc2Index = 2
Else
Doc2Index = 1
End If
Set Doc2 = .Panes(Doc2Index)

Doc2.Activate
Doc2.SmallScroll ToRight:=5
Doc1.Activate
Doc1.SmallScroll ToRight:=5

Set Doc1 = Nothing
Set Doc2 = Nothing

Else

.ActivePane.SmallScroll ToRight:=5

End If
End With

End Sub
'_______________________________________

Run
ActivateKeysUpDown
(Alt-F8 from the main Word window) to activate the End-Home keys new
behaviour.
Change the value in the ToRight and ToLeft statement to get the scroll speed
you want.

This would work best with a template dedicated to those documents.

Create a template with the code, then attach that template to those
documents in which you want that double scrolling behaviour.

Else, change the line
CustomizationContext = ActiveDocument.AttachedTemplate
to
CustomizationContext = ActiveDocument
Add the code to the document itself (Not its template)
and run
ActivateKeysUpDown
to activate the keys.
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
J

Jean-Guy Marcil

Charles Harrison was telling us:
Charles Harrison nous racontait que :
Jean-Guy,
I created a template & biult in your code. It works perfectly. Many
thanks. Charles

Glad I could help!

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
D

Diddakoi

This looks like it this may be the answer I'm seeking for my question,
however, when I tried to do what Jean-Guy has suggested here, I get stuck on
the first step --when I do Alt-F8 from the main Word menu, I don't get
ActivateKeysUpDown as a choice. Am I doing something wrong? (I also have
Word 2003) Any suggestions much appreciated!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top