Jump to content

RickB

Members
  • Posts

    4
  • Joined

  • Last visited

Posts posted by RickB

  1. 3 hours ago, Douglas Cogan said:

    Hi Rick, you mean, don't wrap text around a picture if the graphic frame is empty, right?

    To do this, first give the text frame a name such as "TheTextFrame" in the frame properties dialog box.

    Then make a new OnRecordStart rule (or add to one if you have one.)

    if (Len(Field("TheGraphic")) == 0)
    {
      TextFrame = FindTextFrame("TheTextFrame");
      TextFrame.textWrap=false;
    }

     

    Replace "TheGraphic" with the name of the field that if empty triggers the text to not wrap. Let me know if this works.

     

    So yes, text needs to wrap around a graphic frame which I given it a resource file. This code works perfectly with a text wrap but not a graphic frame wrap.

  2. 4 minutes ago, Douglas Cogan said:

    Hi Rick, you mean, don't wrap text around a picture if the graphic frame is empty, right?

    To do this, first give the text frame a name such as "TheTextFrame" in the frame properties dialog box.

    Then make a new OnRecordStart rule (or add to one if you have one.)

    if (Len(Field("TheGraphic")) == 0)
    {
      TextFrame = FindTextFrame("TheTextFrame");
      TextFrame.textWrap.textWrap =false;
    }

     

    Replace "TheGraphic" with the name of the field that if empty triggers the text to not wrap. Let me know if this works.

     

    Great! Thank you, I'll give it a shot!

  3. 3 minutes ago, Dan Korn said:

    You can't directly determine when a text frame is empty, but, in OnRecordStart, you can test whether whatever field or rule you're inserting into the frame is empty, and if so, turn off text wrap.

    Something like:

    if (!Field("YourFieldName"))
        FindTextFrame("YourFrameName").textWrap = false;

    Or, more succinctly:

    FindTextFrame("YourFrameName").textWrap = !!Field("YourFieldName");

     

    Thank you, I'll give it a go.

×
×
  • Create New...