G
Greg Maxey
Today in separate correspondence I was informed that document variables are
always "string" and I should assign a Long variable value to a string.
I have this situation:
Dim pCcnt As Long
On Error Resume Next
pCcnt = ActiveDocument.Variables("pCcnt").Value
On Error GoTo 0
If pCcnt < 0 Or pCcnt > UBound(pCycleCols) Then
pCcnt = 0
End If
Later on the following code is used
..HighlightColorIndex = CycleCols(pCcnt)
pCcnt = pCcnt + 1
ActiveDocument.Variables("pCcnt").Value = pCcnt
The purpose of the variable is to "remember" the next highlight color to be
used when the document is closed and then reopened.
pCcnt has to be a number to work in the array (at least I think so). If
document variables are "strings" and I should mix the tow, what should I do?
Thank you.
always "string" and I should assign a Long variable value to a string.
I have this situation:
Dim pCcnt As Long
On Error Resume Next
pCcnt = ActiveDocument.Variables("pCcnt").Value
On Error GoTo 0
If pCcnt < 0 Or pCcnt > UBound(pCycleCols) Then
pCcnt = 0
End If
Later on the following code is used
..HighlightColorIndex = CycleCols(pCcnt)
pCcnt = pCcnt + 1
ActiveDocument.Variables("pCcnt").Value = pCcnt
The purpose of the variable is to "remember" the next highlight color to be
used when the document is closed and then reopened.
pCcnt has to be a number to work in the array (at least I think so). If
document variables are "strings" and I should mix the tow, what should I do?
Thank you.