A
Associates
Hi,
I've got the error message that says "Error! No document variable supplied"
coming from DOCVARIABLE.
I have checked many times to ensure that the docvariable can be either some
value or nothing but to no avail.
Here is the code i have in the userform
If Me.txtRecipientTitle.Value <> "" Then
MsgBox "value"
With ActiveDocument
.Variables("title").Value = txtRecipientTitle.Text
.Fields.Update
.PrintPreview
.ClosePrintPreview
End With
Else
MsgBox "no value"
With ActiveDocument
.Variables("title").Value = ""
.Fields.Update
.PrintPreview
.ClosePrintPreview
End With
End If
When i deliberately left the textbox "txtRecipientTitle" empty, it printed
"no value". That's good. Then, when i did printpreview, i got the above error
message. I don't understand where i did wrong.
Any helps are greatly appreciated.
Thank you in advance
I've got the error message that says "Error! No document variable supplied"
coming from DOCVARIABLE.
I have checked many times to ensure that the docvariable can be either some
value or nothing but to no avail.
Here is the code i have in the userform
If Me.txtRecipientTitle.Value <> "" Then
MsgBox "value"
With ActiveDocument
.Variables("title").Value = txtRecipientTitle.Text
.Fields.Update
.PrintPreview
.ClosePrintPreview
End With
Else
MsgBox "no value"
With ActiveDocument
.Variables("title").Value = ""
.Fields.Update
.PrintPreview
.ClosePrintPreview
End With
End If
When i deliberately left the textbox "txtRecipientTitle" empty, it printed
"no value". That's good. Then, when i did printpreview, i got the above error
message. I don't understand where i did wrong.
Any helps are greatly appreciated.
Thank you in advance