• Pass newline characters from Excel to Notes

    By Nick Imboden 1 decade ago

    Hi,

    We're using your merge script to deliver customised training reports to users, which includes lists of courses attended. These lists are of varying lengths and are stored for each user in one excel cell, separated by newlines (ALT+ENTER in Excel). However, these newline characters, or any version thereof (\n,
    , Char(13), Char(10), Char(13) & Char(10) etc.) are currently lost when merging to Notes. The only way I can send people a list is to comma-delimit items on the list on the same line, which is extremely difficult to read.

    Please modify your great script to transmit Excel's newline characters to Notes.

    Thanks in advance!

    • Newlines

      By David Turner 1 decade ago
          <p dir="ltr">
              Thanks for the request Nick,</p>
          <p dir="ltr">
              &nbsp;</p>
          <p dir="ltr">
              Sorry for the delay in getting back to you, work takes priority.<br/>
              I have been looking into this, and unfortunately it is surprisingly difficult.</p>
          <p dir="ltr">
              &nbsp;</p>
          <p dir="ltr">
              The basic findAndReplace operation which currently performs the token replacement with text ignores any newline or special characters which are passed in, so unfortunately I can&#39;t adapt that.</p>
          <p dir="ltr">
              &nbsp;</p>
          <p dir="ltr">
              Replacing this with a function which will more manually iterate through words (tokens) in an email document, find the start and end of the range, and insert text and newlines is complicated, but it somewhat works. Unfortuntely, there are some unusual quirks with extra newlines being added where they shouldn&#39;t, and Notes quite often crashes, especially when trying to debug it. I believe the difficulty lies in how Notes treats paragraphs and styling of paragraphs. 8.5.2 at least doesn&#39;t like it too much.</p>
          <p dir="ltr">
              &nbsp;</p>
          <p dir="ltr">
              A better and more reliable solution might involve DXL manipulation of the document.<br/>
              Sorry I don&#39;t think I&#39;ll have a solution for you in the short term.</p>
      </div>
      

  • Newline support added in v1.4

    By David Turner 1 decade ago

    MailMerge v1.4 now includes a revised function to support new-lines (char:10 or Alt+Enter) wrapped (or added in formula) in text fields.

    It is implemented by cloning the RichText styling around the token, explicitly adding to the text and newlines to the document structure, then deleting the token text.

     

    This works great in my Notes 8.5.2 client so I've released this in the hope this is stable enough for general use, however it still regularly crashes when debugging, so your milage may vary.

    If any issues occur using this function, then either modify your source worksheet to remove newlines, or modify the 'replaceTokenInBody' function code to remove the char(10) check (use the default 'findAndReplace' method.