I've been struggling with this for a little while. I found this MSDN article:
http://msdn.microsoft.com/en-us/library/microsoft.office.infopath.mailenvelope(VS.80).aspx
Which stated that I should be able to:
// Set a reference to MailEnvelope object.
MailEnvelope myEnvelope = this.Application.ActiveWindow.MailEnvelope;
But for the life of me the MailEnvelope wasn't there in my Infopath form.
That was until I turned off Browser compatibility:
Uncheck the following setting:
While designing the form > Tools > Form Options > Compatibility > Design a form template that can be opened in a browser or Infopath
After disabling this setting the EmailEnvelope became available and I could open the Email panel and set all the values (To, cc, subject etc).
All I have to figure out now is if I can catch the send event and close Infopath.
Showing posts with label infopath. Show all posts
Showing posts with label infopath. Show all posts
Thursday, April 2, 2009
Tuesday, February 17, 2009
Infopath: Getting the Form Version in C#
It took a bit of hunting so I thought I should post it up for next time.
To get the Form version of the Infopath template use the following code:
this.Template.Version
Here's a sample of what I did:
XPathNavigator nav = this.CreateNavigator();
string formVersion = this.Template.Version;
nav.SelectSingleNode("/my:FormVersion",
this.NamespaceManager).SetValue(formVersion);
To get the Form version of the Infopath template use the following code:
this.Template.Version
Here's a sample of what I did:
XPathNavigator nav = this.CreateNavigator();
string formVersion = this.Template.Version;
nav.SelectSingleNode("/my:FormVersion",
this.NamespaceManager).SetValue(formVersion);
Sunday, October 5, 2008
Create a new form in Infopath without opening up a Form Library
I found this post and I thought it was really neat. Basically you can create a link anywhere in Sharepoint that creates a new form in Infopath without prompting the user for the "Open, Save As, Cancel" prompt. All you have to do is put this on your page. Change YOURSEVER with your server name, SITE to your site(s) name and FORM LIBRARY with your form libary name:
<a href="javascript:createNewDocumentWithProgID(
escapeProperlyCore('http://YOURSERVER/SITE/FORM LIBRARY/Forms/template.xsn', true),
'http://YOURSERVER/SITE/FORM LIBRARY/',
'SharePoint.OpenXMLDocuments',
true)">Create a New Document</a>
<a href="javascript:createNewDocumentWithProgID(
escapeProperlyCore('http://YOURSERVER/SITE/FORM LIBRARY/Forms/template.xsn', true),
'http://YOURSERVER/SITE/FORM LIBRARY/',
'SharePoint.OpenXMLDocuments',
true)">Create a New Document</a>
Monday, May 19, 2008
Contact Selector in Infopath 2007
First post on my new blog. Yay! Ok after a lot of poking around I found a few articles which appear to have stemed from the Infopath Team Blog The articles seemed promissing enough. So I started up Infopath 2007 and followed the instructions. I stumbled in two places and this is why I'm writing this post. Firstly when you create your Context.xml you also need to specify the port number if you are using one.
So if you get this message and you know there's a "smith" in your AD somewhere then check that you have the correct server address specified in your Context.xml file. After I fixed up that issue I was puzzled by the strange behaviour that I was getting out of the control. After typing in a name and clicking the "check name" button the control would become disabled. The same would happen when I selected a person from the list.
I scratched my head and read over the instructions again. I noticed that one of the instructions mentioned that you should drag the group onto the design surface. Where I had been dragging the repeating field (Person) onto the designer. I should have been dragging the People group on.

I hope this post will save some you some time. Isn't that what it's all about?
If you don't have a correct server name or don't specify the correct port number you'll simply get:
So if you get this message and you know there's a "smith" in your AD somewhere then check that you have the correct server address specified in your Context.xml file. After I fixed up that issue I was puzzled by the strange behaviour that I was getting out of the control. After typing in a name and clicking the "check name" button the control would become disabled. The same would happen when I selected a person from the list.
I scratched my head and read over the instructions again. I noticed that one of the instructions mentioned that you should drag the group onto the design surface. Where I had been dragging the repeating field (Person) onto the designer. I should have been dragging the People group on.

I hope this post will save some you some time. Isn't that what it's all about?
Subscribe to:
Posts (Atom)
