<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Newbie Questions</title><link>https://www.infopathdev.com:443/forums/39.aspx</link><description>New to InfoPath? Search to see if your question has already been answered. If it has not, then ask it here or the appropriate topic forum.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Send Via Email Using Code</title><link>https://www.infopathdev.com:443/forums/thread/4256.aspx</link><pubDate>Fri, 16 Mar 2007 16:48:54 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:4256</guid><dc:creator>nlefaivre</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/4256.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=4256</wfw:commentRss><description>Hi nukkumatti,&lt;br /&gt;&lt;br /&gt;I know this will sound lame, but I am sooo new at this that I need to ask you a couple more questions.&lt;br /&gt;&lt;br /&gt;Programming is not my strong area so - I have put a button on my form, I have set it to use rules or code.  I get to the JS code page and where it says "Write code here" I have copied the first section of code you sent me.&lt;br /&gt;&lt;br /&gt;I save this and then preview my form and get an error message related back to the code.&lt;br /&gt;&lt;br /&gt;So, does the code have to go somewhere specific, did I miss a step?&lt;br /&gt;&lt;br /&gt;I would be so appreciative of any help I can get.  Sorry as this is probably such an easy task but this is my first crack at this and I am at a loss.&lt;br /&gt;&lt;br /&gt;Thanks!&lt;br /&gt;Nathalie</description></item><item><title>Re: Send Via Email Using Code</title><link>https://www.infopathdev.com:443/forums/thread/4255.aspx</link><pubDate>Fri, 16 Mar 2007 06:05:07 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:4255</guid><dc:creator>nukkumatti</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/4255.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=4255</wfw:commentRss><description>For your custom mail you can use this code behind your button:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;MailEnvelope objMail = thisApplication.ActiveWindow.MailEnvelope;&lt;br /&gt;			objMail.To = "";&lt;br /&gt;			objMail.CC = "";&lt;br /&gt;			objMail.Subject = "";&lt;br /&gt;			objMail.Visible = true;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You can use below class to pass either the users login (samacountname) name, real name (name) or eMail (mail) and retrieve the corresponding manager from active directory. like this you can auto  populate the objMail.To already with the manager of the requestor.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;using System;&lt;br /&gt;using System.Text;&lt;br /&gt;using System.DirectoryServices;&lt;br /&gt;using System.Collections;&lt;br /&gt;&lt;br /&gt;namespace YourNameSpace&lt;br /&gt;{&lt;br /&gt;	/// &amp;lt;summary&amp;gt;&lt;br /&gt;	/// Summary description for AD_Helper.&lt;br /&gt;	/// &amp;lt;/summary&amp;gt;&lt;br /&gt;	public class AD_Helper&lt;br /&gt;	{&lt;br /&gt;		string var;&lt;br /&gt;&lt;br /&gt;		public AD_Helper()&lt;br /&gt;		{&lt;br /&gt;		}&lt;br /&gt;//1 parameter: what do you path (name, mail etc.), 2nd actual value, third what to you want, so if I liked to get my manager assuming that nukkumatti is my login name I had to call the method like getProperties("samaccountname", nukkumatti, "manager").&lt;br /&gt;&lt;br /&gt;		public string getProperties(string criteria, string givenValue, string searchValue)&lt;br /&gt;		{&lt;br /&gt;			try&lt;br /&gt;			{&lt;br /&gt;				// Create a directory searcher on the path provided when created the instance&lt;br /&gt;				DirectoryEntry entry		= new DirectoryEntry("LDAP://OU=Husky Users,DC=corp,DC=huskyims,DC=com");&lt;br /&gt;				DirectorySearcher searcher	= new DirectorySearcher(entry);&lt;br /&gt;&lt;br /&gt;				string ToFind				= "(" + criteria +"=" + givenValue + ")";&lt;br /&gt;				searcher.Filter				= ToFind;&lt;br /&gt;&lt;br /&gt;				// Try to find the employee &lt;br /&gt;				SearchResult result			= searcher.FindOne();&lt;br /&gt;				if (result != null)&lt;br /&gt;				{&lt;br /&gt;					// Get the 'DirectoryEntry' that corresponds to 'result'.&lt;br /&gt;					DirectoryEntry myDirectoryEntry = 	result.GetDirectoryEntry();&lt;br /&gt;					&lt;br /&gt;					// Get the properties of the 'mySearchResult'.&lt;br /&gt;					ResultPropertyCollection myResultPropColl;&lt;br /&gt;					myResultPropColl	=	result.Properties;&lt;br /&gt;					&lt;br /&gt;					foreach(Object myCollection in myResultPropColl[searchValue])&lt;br /&gt;					{&lt;br /&gt;						var		=	myCollection.ToString();&lt;br /&gt;					}&lt;br /&gt;				}&lt;br /&gt;			}&lt;br /&gt;			catch (Exception ex)&lt;br /&gt;			{&lt;br /&gt;				ex.Message.ToString();&lt;br /&gt;			}&lt;br /&gt;			return var;&lt;br /&gt;		}&lt;br /&gt;	}&lt;br /&gt;}&lt;/pre&gt;</description></item><item><title>Send Via Email Using Code</title><link>https://www.infopathdev.com:443/forums/thread/1916.aspx</link><pubDate>Thu, 15 Mar 2007 18:52:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:1916</guid><dc:creator>nlefaivre</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/1916.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=1916</wfw:commentRss><description>Hi There,&lt;br /&gt;&lt;br /&gt;I am working on some forms for our firm.  I am currently working on our vacation request form.  I would like to automate it so that once the staff member fills in their portion, they can email it to their supervisor.  The supervisor in turn will fill in their portion and then forward it on to HR.&lt;br /&gt;&lt;br /&gt;The submit to HR is easy as it is always the same address so I was able to use the "Submit" feature on the button control.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;What I would like to do now is add a second button after the staff section that would email the form to their supervisor.  I would like them to click the button, and a new email message would open up with the form attached. This would allow users to email a variety of staff members at a time.  As each staff member potentially has a different lawyer or supervisor they need to be able to access the outlook addresses.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Can anyone help me out with this?&lt;br /&gt;&lt;br /&gt;Thanks!&lt;br /&gt;Ropegun</description></item></channel></rss>