Hi everyone,
I thought this would be easy, but I cannot find anything on how to do it.
I have a process that pastes x pages, does things, pastes x pages, does things, etc.
After the paste of x pages, the cursor is at the bottom of the last page.
I need to select (highlight) the previous x pages that just pasted. I was hoping the below code would work, but all it does is move the cursor to the top of the first set of pages that just pasted. If it would move/select that "range" it just moved through to get to the top of first of x pages just pasted, it would be perfect.
I want to do this because the process I run on each set of pages starts fast then gets progressively slower because it is looking at the entire document.
I thought this would be easy, but I cannot find anything on how to do it.
I have a process that pastes x pages, does things, pastes x pages, does things, etc.
After the paste of x pages, the cursor is at the bottom of the last page.
I need to select (highlight) the previous x pages that just pasted. I was hoping the below code would work, but all it does is move the cursor to the top of the first set of pages that just pasted. If it would move/select that "range" it just moved through to get to the top of first of x pages just pasted, it would be perfect.
Code:
'Note, this code is in vb.net, but if you have a vba solution, I can mod it into vb.net.
Dim MergeRange As Range
MergeRange = app.Selection.GoTo(WdGoToItem.wdGoToPage, which:=WdGoToDirection.wdGoToPrevious, Name:=(k + (NumOfPagesInDoc - 1)))
I want to do this because the process I run on each set of pages starts fast then gets progressively slower because it is looking at the entire document.