1 Reply Latest reply: Mar 31, 2014 1:41 AM by Tresesco B RSS

    VB function not work

    Rein Nigul

      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

        • Re: VB function not work
          Tresesco B

          Try like:

           

          if trim(vbPRoductID)=trim(vPRoductID) then

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

          else

                msgbox("Wrong")

          end if