Emailing and Printing - InfoPath Dev
in

InfoPath Dev

Emailing and Printing

Last post 03-27-2005 04:15 PM by Shanthi Reddy. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 11-02-2004 10:47 AM

    Emailing and Printing

    Of course, the email issue sounds like a simple one. I'd like to capture the submit, to which I think I know how, but I need to know how to programmatically email someone.

    Also, when print a form, the controls still display on the form (which looks tacky). Is there anyway to print out the form without the controls displaying?
  • 11-02-2004 04:13 PM In reply to

    For programmatically sending an email, the first thing to note is that a dialog will appear asking the user to accept the email being sent. This is a security dialog and cannot be gotten around (sorry).

    Create an email data connection and then add the following to your code (this is in C#):

    EmailAdapter oEmail = (EmailAdapter)thisXDocument.DataAdapters["Email Submit"];
    oEmail.To = "";
    oEmail.CC = "";
    oEmail.Subject = "";
    oEmail.Intro = "";
    oEmail.AttachmentFileName = "";

    oEmail.Submit();


    As for the controls displaying on print, have you tried creating a print view? You can use expression boxes to show the data instead of the other controls.

    Greg Collins [InfoPath MVP]
  • 03-16-2005 11:12 AM In reply to

    Greg:

    What is the difference between the EmailAdaptor call and the .ShowMailItem in jscript? Is there a way to call the same adaptor from jscript and will it allow me to NOT send the form as an attachemnt?

    "One Line at a Time" - anonymous codeaholic
    Greg McAllister
  • 03-27-2005 04:15 PM In reply to

    The one difference that i can see for these two calls is that for the email adapter you have a choice while creating the data connection whether you want to send the form as an attachment or not, but as part of ShowMailItem the form will always be sent as an attachment.
    Shanthi Reddy
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.