Variable problem "Error! No document variable supplied."

C

camilla

Does anyone know why this errormessage appear with only some of the
variables.
Im only use Insert field - Docvariable and named as Variable_1, Variable_2
aso.
Some of them works fine and some will not work.

Thanks
Camilla
 
D

Doug Robbins - Word MVP

Hi Camilla,

If no value/data is assigned to a variable you will get that error.

Use something like

If [whateveritis} = "" then [documentobject].Variables{"variablename").Value
= " "

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
C

camilla

Hi
I found out a workaround, if I open the template and run the macro, show the
userform and leave all fields blank, press OK and then it's works OK.


Doug Robbins - Word MVP said:
Hi Camilla,

If no value/data is assigned to a variable you will get that error.

Use something like

If [whateveritis} = "" then [documentobject].Variables{"variablename").Value
= " "

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
camilla said:
Does anyone know why this errormessage appear with only some of the
variables.
Im only use Insert field - Docvariable and named as Variable_1, Variable_2
aso.
Some of them works fine and some will not work.

Thanks
Camilla
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top