P
Phil Vern
When I open a document containing a table I do some editing (using VBA) in a
cell off the screen. This causes the document to visually move to the right
to bring the cell onto the screen. Afterwards, I need the top left section of
the document redisplayed on my screen. At the moment, I'm using a workaround
to achieve this - I select cell(1, 1) which is the top left of the document,
insert a period (ie ".") and then delete the period. But, how do I move the
top left corner of the document into view without doing any editing? It would
be much safer for any text already there.
Note: I have also tried turning ScreenUpdating off, but it has no affect on
this.
Thanks for your help.
My current code:
myDocument.Tables.Item(1).Cell(1, 1).Select()
With myDocument.ActiveWindow.Selection
.HomeKey() ' Sets insertion point at start of cell
.Range.InsertAfter(".") ' Inserts a period
.HomeKey(wdLine, wdExtend) ' Selects period
.Delete() ' Deletes period
End With
cell off the screen. This causes the document to visually move to the right
to bring the cell onto the screen. Afterwards, I need the top left section of
the document redisplayed on my screen. At the moment, I'm using a workaround
to achieve this - I select cell(1, 1) which is the top left of the document,
insert a period (ie ".") and then delete the period. But, how do I move the
top left corner of the document into view without doing any editing? It would
be much safer for any text already there.
Note: I have also tried turning ScreenUpdating off, but it has no affect on
this.
Thanks for your help.
My current code:
myDocument.Tables.Item(1).Cell(1, 1).Select()
With myDocument.ActiveWindow.Selection
.HomeKey() ' Sets insertion point at start of cell
.Range.InsertAfter(".") ' Inserts a period
.HomeKey(wdLine, wdExtend) ' Selects period
.Delete() ' Deletes period
End With