Announcement

Collapse
No announcement yet.

Have I programmed this correctly?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Have I programmed this correctly?

    PB COM Browser:

    Member Call ApplyParagraphStyle <1482780787> (In PB_Using As IndesignParagraphStyle<0>, Opt In ClearingOverrides As _
    Integer<1>)

    My code:

    GLOBAL vtemp AS VARIANT
    ...
    ...
    vtemp = 1
    OBJECT CALL myInsertionPoint.ApplyParagraphStyle(myParagraphStyle, vtemp)
    ...
    ...

    This compiles correctly and changes the paragraph style but the vtemp doesn't seem to do anything,
    (I expect it to cancel the current character style).

    Have I programed this correctly?

  • #2
    Originally posted by Robert Wallace View Post
    Have I programed this correctly?
    working code would help!

    Comment


    • #3
      Working code - however "Bob" appears in the previous character style containing Wingdings whereas it should be in a "None" style
      by the "ClearingOverrides"

      Code:
      FUNCTION StartPara() AS LONG
      100:
        ON ERROR GOTO StartPara_Error
        IF verifying = 0 THEN
          IF cellopen = 0 THEN
            OBJECT GET myTextFrame.InsertionPoints.lastItem TO myInsertionPoint
          ELSE
            OBJECT GET myCell.InsertionPoints.lastItem TO myInsertionPoint
          END IF
          vtemp = 1  ' I have also tried "%true" with no effect
          OBJECT CALL myInsertionPoint.ApplyParagraphStyle(myParagraphStyle, vtemp)
      '----------Test code---------------------------------
          OBJECT GET myParagraphStyle.name TO vtemp
          IF VARIANT$(vtemp) = "BODY-Sidebar" THEN
            vtemp = "Bob"
            OBJECT SET myInsertionPoint.contents = vtemp
          END IF
      '----------End of Test code-------------------------------------------------
          endofline = 1
        END IF
      EXIT FUNCTION
      
      StartPara_Error:
      MSGBOX ERROR$(ERR), %MB_ICONERROR, "StartPara"
      END FUNCTION

      Comment

      Working...
      X