I have a Macro that is finding a value of a bookmark in the body of a document and I am then changing another value of a bookmark in the header accordingly.
This works fine while destination bookmark is in the body of the document but has the above error if I move the destination bookmark to the header.
Using a recorded macro has the same problem.
It seems even though you are in the header when you run the macro it reverts to only looking at the body.
Can anyone explain why this is? and or give me a solution to the problem.
I see this is close, but having an input box isn't what I have and I don't know the piece I need to add to my code to make it work...
Dim lngValue As Long
'Selection.GoTo What:=wdGoToBookmark, Name:="RM0TotalInclGST"
Selection.GoTo What:=wdGoToBookmark, Name:="RM0TotalInclGST"
.DefaultSorting = wdSortByName
.ShowHidden = False
Selection.MoveRight Unit:=wdCharacter, Count:=2, Extend:=wdExtend
lngValue = Selection.Text
Selection.GoTo What:=wdGoToBookmark, Name:="INVOICETYPE"
If Val(lngValue) < 0 Then
Selection.Text = "CREDIT NOTE"
Selection.Text = "TAX INVOICE"