Jason\Gerry
So how would you adapt this code? I'll ask him to try a modified version.
Sub CaseStatementOddity()
Dim strPrefix1 As String
Dim strPrefix2 As String
Debug.Print ActiveDocument.Variables("varTest").Value 'Returned "Test 1"
Select Case ActiveDocument.Variables("varTest").Value
Case "Test 1"
strPrefix1 = "A - "
strPrefix2 = "B - "
Case "Test 2"
strPrefix1 = "C - "
strPrefix2 = "D - "
End Select
Debug.Print strPrefix & " " & strPrefix2 'Returns "A - B -" on my system. Returns "" on other system.
End Sub
Sub WordAround()
Dim strPrefix1 As String
Dim strPrefix2 As String
If ActiveDocument.Variables("varTest").Value = "Test 1" Then
strPrefix1 = "A - "
strPrefix2 = "B - "
ElseIf ActiveDocument.Variables("varTest").Value = "Test 2" Then
strPrefix1 = "C - "
strPrefix2 = "D - "
End If
Debug.Print strPrefix & " " & strPrefix2 'Returns "A - B -" on both systems.
End Sub