Skip navigation
Currently Being Moderated

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

Apr 5, 2012 4:21 AM

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

            .Close

        End If

    End With

 

 

Thanks.

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points