Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
rein_nigul
Contributor
Contributor

VB function not work

Can anyone tell me why is the function in response to the "wrong"


Function test

vbPRoductID=5
set v = ActiveDocument.Variables("vbPRoductID")
v.SetContent vbPRoductID,true 

set v = ActiveDocument.Variables("vbPRoductID")
vPRoductID = v.GetContent.string

msgbox(vbPRoductID)
msgbox(vPRoductID)


if vbPRoductID=vPRoductID then
      msgbox=("Right")
else
      msgbox("Wrong")
end if
end function
 

 

Rein

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try like:

if trim(vbPRoductID)=trim(vPRoductID) then

      msgbox("Right")                                               ''''' typo '=' removed

else

      msgbox("Wrong")

end if

View solution in original post

1 Reply
tresesco
MVP
MVP

Try like:

if trim(vbPRoductID)=trim(vPRoductID) then

      msgbox("Right")                                               ''''' typo '=' removed

else

      msgbox("Wrong")

end if