Email code query - InfoPath Dev
in

InfoPath Dev

Email code query

Last post 03-23-2009 04:18 PM by Ian Dawson. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-19-2009 11:11 PM

    • Ian Dawson
    • Top 50 Contributor
      Male
    • Joined on 01-01-2009
    • Shellharbour NSW Australia
    • Posts 154

    Email code query

    Hi Hilary,

    Thanks for your replies to other queries before.  Like for the 7 tables, can't submit.  I moved all the supplier info into the customer master table.
    That will have to do.

    Anyway, this time I am asking about your document you published about emailing.

    Well, before I start, I need to have an email facility, that allows me to send the entire form as is, with out the control boxes etc. So can I do that without using code?
    If not I assume the document you published would be useful for completing a successful email.

    In your document, you referred to "top of your code window", 
     then
                                                     "with the other using statements"   or import statements

    [[As an aside, I know you mostly only see a fraction of the modules in VB or C or any other system,
        that call in functions and the like from various libraries. ]]

    Am I assuming you mean - top of my window open, but within the function declaration area. Or is it at the top unbounded function brackets {}

    An aside comment (my/myfields/my:textfield and my/myfields/my:datefields are the 2 controls you define on the form.)

    In the code you typed in, IS all the red code is code for me to change?
    Is it effectly hard wired?  Or is there someway of setting it with a variable?
    What I am getting at here is I may want to send the form off to different people at times. 
    Can you confirm that I can set up a variable, and if you know, how is it possible?

    I plan to only test and use Scenario 1 for now.

    Thanks ahead for your  responses.
    Ian

  • 03-21-2009 04:15 AM In reply to

    Hi, Ian:

    What version of InfoPath are you using? 2003 or 2007? Is the built in email submit insufficient for what you need to do? What do you mean by send the form 'as is' without the control boxes, etc -- you just want to send the data?

    For our internal forms, sometimes we create a section that we use for an email view -- with the 'regular' form in another section. Add a field called 'IsEmailing' or something, add conditional formatting to hide the regular section and show the email section if IsEmailing is true. Then, in a submit button, set IsEmailing to true, submit using the email connection, and set IsEmailing back to false. This may work for your current needs.

    However, to answer your questions about the blog post -- when you open VSTA for your form, if you are using C# for the programming language, you will see some 'using' statements at the top of the code editor window. If you are using VB.NET, those statements will say 'imports'. From the C# reference on MSDN:

    The using directive has two uses:

    • To permit the use of types in a namespace so you do not have to qualify the use of a type in that namespace.

    • To create an alias for a namespace or a type.

    In this instance, the first bullet applies.

    The color highlighting in the code samples is simply standard Visual Studio color highlighting, with strings in a reddish font. The green text is comments. In the sample, I am using form values in the email I'm sending -- is that what you mean by 'set up a variable'? You can access all the data fields in your form in code, and use those values in your email, if that is what you are asking.....

    Hilary Stoupa

  • 03-23-2009 04:18 PM In reply to

    • Ian Dawson
    • Top 50 Contributor
      Male
    • Joined on 01-01-2009
    • Shellharbour NSW Australia
    • Posts 154

    Hi Hilary,
    Sorry for the delay in responding,
    I have been away for a few days.

    In reply to your query, I am, using InfoPath2007.

    In response to another of your queries, I find that when I try to make a print view, with various controls, the variables diiferent controls seem to have a different bottom positions. I have decided to replace all the controls and use only expression boxes in the print view.
    Yesterday and all of today, I spent a lot of time removing all the boxes around the expression boxes etc. With over 50 Drop downs, and about 3 choices in each DD, it has been taking some time. Maybe there is an easier way? 
    Yes I think I found out why, by changing the bottom margin from one (1) px to zero px. The rows then seem to line up.

    Can I set my system up to have a default zero px. That way everything shuld line up.

    I continue learning how to use the e-mail function.
    I can send email without the need to write code. I am still testing, but think I have worked it out. depends on data connections, submit or rules commands.

    I presume that the code, you described, and I originally queried above, is to be used for special cases, like segments of the form to be extracted and mailed.

    Finally, I would also like to be able to totally lock down the security of the forms construction,
    before I hand over to other people.
    The enable protection switch seems to be pretty weak, and easily worked around.  Is there a way to secure it?   I know I have asked before.

    I have tried to customise the menu bar.

    I think, if the user gets hold of alternate system screen they may be able to over ride that too! I have!

    Thanks for your time.
    Ian

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.