Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
i have a req like
if i selected project -sales then store it in C drive
if i select any other project then store it in E drive
for this
i have created variable for c path location and e pathlocation
c path location variable name is vnewdev
e path location variable is volddev
and getfieldselections(project) - variable name is vproject
here my macro is
set vpro=activedocument.variables("vproject")
if vpro = "sales"
then
set dev=activedocument.variables("vnewdev")
else
set dev=activedocument.variables("volddev")
end if
i wrote like this but still it is showing syntax error
why ? what is the wrong here?
Hi
you just set the variable to vpro.
You further need to check the Content of the variable.
Therefore try this:
sub Test
set vpro = ActiveDocument.Variables("vProject")
if vpro.GetContent.String = "sales" then
msgbox("Location C")
else
msgbox("Location E")
end if
end sub
Best regards,
Patrick