msnyder701
05-14-2018, 09:59 PM
I'm using Word 2010. I have the following code:
Public LastBodyPage
Sub tryit()
Selection.GoTo What:=wdGoToBookmark, Name:="AppendixStart"
LastBodyPage = Selection.Information(wdActiveEndPageNumber)
End Sub
Sub vardel()
MsgBox Variables.Item("LastBodyPage").Value
MsgBox LastBodyPage
End Sub
The first procedure puts a particular page number into LastBodyPage, equal to the page number where the bookmark "AppendixStart" is located.
When I run the second procedure, the first MessageBox statement returns a value of "53" (the page number where the bookmark is located. But the second MessageBox statement prints out "50".
Why are the values different???
Public LastBodyPage
Sub tryit()
Selection.GoTo What:=wdGoToBookmark, Name:="AppendixStart"
LastBodyPage = Selection.Information(wdActiveEndPageNumber)
End Sub
Sub vardel()
MsgBox Variables.Item("LastBodyPage").Value
MsgBox LastBodyPage
End Sub
The first procedure puts a particular page number into LastBodyPage, equal to the page number where the bookmark "AppendixStart" is located.
When I run the second procedure, the first MessageBox statement returns a value of "53" (the page number where the bookmark is located. But the second MessageBox statement prints out "50".
Why are the values different???