4 Replies Latest reply on Feb 24, 2017 12:19 PM by try67

    Scripted text from Acrobat and Microsoft Outlook emails

    ddunn@davidsdunn.com Level 1

      I have scripted "canned" emails that employ rich text formatting, such as line returns and tabs using \r and \t. Using a mouse up action with a button and the app.mailMsg method, the script opens my default email client, Mail.app, and generates the email, ready to send to the addressee. The addressee and contents of the email are determined by values entered in other fields that are referenced within my script as variables.

       

      I also want this script to work with Microsoft Outlook, but Outlook seems to only offer HTML and plain text. The rich text formatting is ignored by Outlook.

       

      So my question is this: can I amend my script to place line breaks, returns and tabs into either plain text or HTML email message in Outlook?

       

      David

        • 1. Re: Scripted text from Acrobat and Microsoft Outlook emails
          try67 MVP & Adobe Community Professional

          What you're describing is not really "rich text formatting". That suggest specifying the font style, size, color, etc., and that can't be done using a script. The only thing you can use is plain-text, which includes line-breaks, tabs, etc.

          That should work in all email clients.

          • 2. Re: Scripted text from Acrobat and Microsoft Outlook emails
            ddunn@davidsdunn.com Level 1

            In that case I'm not aware of the underlying problem, but I'll try to explain.

             

            I have several buttons in my form, each adjacent to a text field that contains an email address. The mouse up action on each button has a script attached that employs the app.mailMsg method, with the various parameters, and sets the body of the email to include canned text mixed with values passed to it from variables referencing fields within my form. The script employs formatting such as \r and \n and \t for new paragraphs and indented lines.

             

            When my default mail client is set to Apple's mail and I execute that script, the script initiates the message with all intended formatting in the message body. However, if my default mail client is set to Outlook or Spark, the body of the message loses the intended formatting, and therefore I have only one long line run together, such as "DearJohn,Enclosed you will find ABCDEF.Please do Y.Thank you.Sincerely,David."

             

            I realize not all mail clients may permit the result that is achieved with Apple Mail, but I want other predominant mail clients to employ the intended formatting, so that others using my form can use these canned emails. Perhaps I just don't know the correct mail client settings that are required. I tried setting Outlook to both plain text and html, but neither works. So what do I need to focus on to achieve that end?

             

            I know that on Windows the default mail client must be configured to MAPI to use the app.mailMsg method, but I still lose the formatting when the email message is generated by my script.

            • 3. Re: Scripted text from Acrobat and Microsoft Outlook emails
              rh404

              I am also having the same issue using Outlook for Mac. The body of the message in Outlook ends up all on one line.  I  have tried both adding both  + "\n" +  and + "\r" +  between the lines but neither of them seem to work.

               

              Does anyone know if there is a character that will make these line breaks work in Outlook for Mac?

              • 4. Re: Scripted text from Acrobat and Microsoft Outlook emails
                try67 MVP & Adobe Community Professional

                Sounds like a bug in Outlook. You should report this issue to Microsoft.