E-mail button on Livecycle created PDF not working

mike_silver
mike_silver used Ask the Experts™
on
Attached is a form created using Adobe Livecycle. The "Submit by E-mail" button is from the standard Livecycle object library. Unfortunately using this button does not work in Adobe Reader (we use Reader 9+) because only the data is e-mailed, not the whole PDF form. Most of my users have Reader, no Acrobat. I have found code on the web to create my own e-mail button, which is marked with just a "1" on the button on top of the form. The code compiles without errors but the mydoc.maildoc does not execute. If I put a messagebox on both sides of the mydoc.maildoc statement the messagebox below the mydoc.maildoc  does not execute, telling me that there is something wrong with the mydoc.maildoc statement. As you can see in the code I've tried several iterations of the code.

In addition, I'd like to pull a couple of the fields, FranchiseeLastName + FranchiseeFirstName + a date/time stamp and save the file to a network directory for backup right before or after the mydoc.maildoc executes. So I'm also trying to figure out how to use the saveas command.
Notice-Of-Loss.pdf
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
When you open the JavaScript console before you click the button, you will see the following error message:

mydoc.maildoc is not a function
3:XFA:form1[0]:Page1[0]:HeaderSubform[0]:Button1[0]:click
mydoc.maildoc is not a function
3:XFA:form1[0]:Page1[0]:HeaderSubform[0]:Button1[0]:click

It looks like you did not define that function. Saving the file will require that the form is reader enabled - otherwise somebody with just Reader will not be able to save the file. If you want to use Acrobat to reader enable your document, there are licensing restrictions (up to 500 copies distributed, or 500 returned copies processed).

Author

Commented:
Thanks for seeing that. But I need the coding for e-mailing and for save-as.
Your question is a bit ambiguous about what you want: Do you want to return the whole PDF file or just the form data? If it's the whole PDF file, that's not possible with Reader - maybe that's the problem you are running into. There is no custom script that will do that for you. The only way to accomplish that is by reader enabling the document, which you can do with Adobe Acrobat, but you have to stay withing the 500 copies/processed documents limit.
Success in ‘20 With a Profitable Pricing Strategy

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
The form is located on my network. The user's of the form are all in-house. This is what I want to happen:
1) When the user opens the form I want it to automatically save-as to c:\temp\notice of loss.pdf so that they are not modifying the original form. I am already doing this with a .bat file and then opens the copy of the form, so this part is not crucial but it would be better programming.
2) User fills in the form.
3) When the user presses the "Save & E-mail" button it would save the form to j:\somedirectory\notices of loss\lastname_firstname_DOLyyyymmdd_Reportyyyymmdd.pdf and then e-mail the form to claims@snaponsecurecorp.com, where the following fields are pulled from the form:
   a) lastname = FranchiseeLastName
   b) firstname = FranchiseeFirstName
   c) DOLyyyymmdd = LossDate
   d) Reportyyyymmdd = ReportDate

The e-mail needs to send the whole PDF, not just the data. I know it can do that because Reader has the "Attach to E-mail..." command which creates an e-mail and attaches the currently open form. The form is Reader enabled through Acrobat.

Author

Commented:
Can anyone help?
I've got the naming figured out if ANYONE can help with the SaveAs. I'll close in 1 week if nobody helps.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial