Community articleSetLiteralEx function
Added by IBM contributorIBM on May 2, 2012
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

No abstract provided.


This function sets the literal of a node. You should only set the literal for option or argument nodes.
Note: It is not necessary to call this function when you are using XForms. Use the UpdateXFormsInstance function instead.


   Sub SetLiteralEx(
      theCharSet As String, 
      theLiteral As String)


Table 1. Function parameters
theCharSetStringThe character set in which theLiteral parameter is written. Use null for ANSI/Unicode. Use Symbol for Symbol.
theLiteralStringThe literal to assign to the node. If null, any existing literal is removed.


Nothing if call is successful or throws an exception if an error occurs.

Usage details

Digital signatures:
Do not set the literal of a node that has already been signed. Doing so will break the digital signature and produce an error.


The following function copies the value from one field to another. First, the function uses DeferenceEx to locate the value node of a field on page one and reads the value using GetLiteral. Next, the function locates a value node on page two and writes the literal to that field using SetLiteralEx.
   Sub CopyValue(Form)
      Dim TempNode  ' object
      Dim theName  ' string
      Set TempNode = Form
      ' Locate the NameField on page 1
      Set TempNode = TempNode.DereferenceEx(vbNullString, _
         "PAGE1.NameField.value", 0, UFL_OPTION_REFERENCE, Nothing)
      ' Get the literal from the value node
      theName = TempNode.GetLiteral
      ' Locate the NameField on page 2
      Set TempNode = TempNode.DereferenceEx(vbNullString, _
         "PAGE2.NameField.value", 0, UFL_OPTION_REFERENCE, Nothing)
      ' Write the literal that was read from the first value node
      TempNode.SetLiteralEx vbNullString, theName
   End Sub

Parent topic:
FormNodeP functions