2 Replies Latest reply: Apr 5, 2012 4:53 AM by katerpillar77 RSS

    Importing text into rich text field - cuts off first character of each line

    katerpillar77 Community Member

      I am importing text from Access 2003 into Acrobat X. It is automated from Access using the Acrobat library. The imported text contains line breaks which are created in SQL using chr(13) & chr(10). To change the way in which the text is created would be awkward.


      When this text is placed into a rich text field in Acrobat, I lose the first character of the second and subsequent lines. This does not happen if the field is not rich text. Unfortunately, the users want it to be rich text so they can underline words.


      Does anyone know how to fix this? Obviously there is a bodge of putting a space at the beginning of each line so that this space is cut, but I would prefer not to as this text is used in other places.


      The relevant bit of VBA code is this:

      (inputs are strFile = filename, strField = name of field in Acrobat, strValue = imported text)


          Set acroApp = CreateObject("acroexch.app")

          Set acrodoc = CreateObject("acroexch.pddoc")

          With acrodoc

              If .Open(strFile) Then

                  Set jso = .GetJSObject

                  If Not jso Is Nothing Then

                      jso.getField(strField).value = strValue

                  End If

                  .Save PDSaveFull, strFile


              End If

          End With