Link to home
Start Free TrialLog in
Avatar of drtopserv
drtopservFlag for Israel

asked on

fix javascript code in acrobat pro to be able to bold the text send by the javascript form bottom to outlook email body

Hi,
see javascript code below (written in adobe acrobat pro javascript editor)
 
this code attached to button in pdf form . when click on the button it attached the pdf to new mail in outlook and fill the subject and the body of the email.
i need to have the body of the email BOLD  , how can i achieve this?

CODE:

// This is the form return email. It's hardcoded

// so that the form is always returned to the same address.

// Change address on your form to match the code below

var cToAddr = ""


// First, get the client CC email address

var cCCAddr = this.getField("ClientEmail").value;

// Now get the beneficiary email only if it is filled out

var cBenAddr = this.getField("BennyEmail").value;

if(cBenAddr != "")

cCCAddr += ";" + cBenAddr;

// Set the subject and body text for the email message

var cSubLine ="return protocol for fix - " + " company name: " + this.getField("company name").value  + " , " + " branch number: " + this.getField("branch name").value + " , " +  " account number: " + " " + this.getField("account number").value

var cBody = "Hi,\n\n Please see hed protocol"

 

// Send the entire PDF as a file attachment on an email

this.mailDoc({bUI: true, cTo: cToAddr, cCc: cCCAddr, cSubject: cSubLine, cMsg: cBody});

}
else {
}
Avatar of Zakaria Acharki
Zakaria Acharki
Flag of Morocco image

Have you tried to format it as HTML like :

var cBody = "<b>Hi,\n\n Please see hed protocol</b>";

Open in new window

Avatar of drtopserv

ASKER

i try this , it does not work ,
it bypass the text in the body of the outlook email as it .
means it just added the <b>   ...TEXT.. </b>
I'm afraid that there's no possibility to format the body text as in the documentation you find :

cMsg : A string containing the message to be displayed.

There's a set of similar questions everywhere even in the official forum with no answers what lead me to say there's no HTML option in the body tag until now.
ok thanks if there is no option.
may a help how can i click in "B" in the outlook toolbar to make it bold manually ?

the problem is that the button clicked on the pdf form will bring me to "new email" window that the "B" option in toolbar is grayed out!
it is outlook client apps.
if i make new email from within outlook , it give me full access to toobar that i can make any "B" "I" "U" , but throught pdf button it is all grayed out
Yes, I see that there's a rule in the new emails coming from pdf form that prevent any further formatting by graying the options.

The rule designed to preserve the original format (I'm not sure why) but can't find any workaround or hack to pass it, Sorry.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.