S
skrimpy
I have been provided this code from some wonderful collegues on this
site.(Word 2000 and XP)
Set myrange = Selection.Bookmarks("\Page").Range
myrange.End = myrange.End - 2
myrange.Collapse wdCollapseEnd
myrange.Cells(1).Range.Select
Selection.HomeKey Unit:=wdRow
It works great for selecting the last row on a given page(table is most
of the document and stretches from page to page).
As Im looping through my document and using the bottom left corner as a
reference point to make changes to my document this line fails when the
next jump is off of the table. ("Run-Time error '5941' The requested
member of the collection does not exist")
myrange.Collapse wdCollapseEnd
I need my loop to stop if this code jumps off of the table, or this
code(Selection.MoveDown Unit:=wdLine, Count:=1) jumps off the table.
Does anyone know if it is more correct to use an error handling
statement for this, or is there a better way to break the loop?
Thanks!
Dan
site.(Word 2000 and XP)
Set myrange = Selection.Bookmarks("\Page").Range
myrange.End = myrange.End - 2
myrange.Collapse wdCollapseEnd
myrange.Cells(1).Range.Select
Selection.HomeKey Unit:=wdRow
It works great for selecting the last row on a given page(table is most
of the document and stretches from page to page).
As Im looping through my document and using the bottom left corner as a
reference point to make changes to my document this line fails when the
next jump is off of the table. ("Run-Time error '5941' The requested
member of the collection does not exist")
myrange.Collapse wdCollapseEnd
I need my loop to stop if this code jumps off of the table, or this
code(Selection.MoveDown Unit:=wdLine, Count:=1) jumps off the table.
Does anyone know if it is more correct to use an error handling
statement for this, or is there a better way to break the loop?
Thanks!
Dan