A
Ahmad
I have created 4 document variables into Word document and noted the
file size. then i deleted all the document variables. and then again
noted the file size. but unfortunately there is no change in the file
size. I used the following code to view the variables and then deleted
them.
Dim Response
Dim myVar As Variable
For Each myVar In ActiveDocument.Variables
Response = MsgBox("The document variable: " & myVar.Name & vbCr &
_
"Value: " & myVar.Value & vbCr & vbCr & _
"Do you want to delete the variable from this document?",
vbYesNo)
If Response = "6" Then
' Delete the variable.
myVar.Delete
Else
End
End If
Next myVar
MsgBox "There are no variables in the document."
so is there any body to let me know where the problem lies.
Thanks
Ahmad
file size. then i deleted all the document variables. and then again
noted the file size. but unfortunately there is no change in the file
size. I used the following code to view the variables and then deleted
them.
Dim Response
Dim myVar As Variable
For Each myVar In ActiveDocument.Variables
Response = MsgBox("The document variable: " & myVar.Name & vbCr &
_
"Value: " & myVar.Value & vbCr & vbCr & _
"Do you want to delete the variable from this document?",
vbYesNo)
If Response = "6" Then
' Delete the variable.
myVar.Delete
Else
End
End If
Next myVar
MsgBox "There are no variables in the document."
so is there any body to let me know where the problem lies.
Thanks
Ahmad