<?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: Errors when trying to add to outlook calendar using form fields</title><link>https://www.infopathdev.com:443/forums/thread/75362.aspx</link><pubDate>Thu, 16 Feb 2012 11:21:58 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:75362</guid><dc:creator>socknose</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/75362.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=75362</wfw:commentRss><description>&lt;p&gt;OK, sorted that now. It was the formatting of the&amp;nbsp;date picker and not having the correct&amp;nbsp;xpath that was at fault. The problem I&amp;#39;m running into now is that this button sits in a repeating field and, when you add another&amp;nbsp;field it only refers to the first incident of the date picker.&amp;nbsp;Can someone explain to me&amp;nbsp;(in very simplistic terms) how I go about referencing repeating fields in VBA?&amp;nbsp;I can&amp;#39;t find any decent articles on how to do it online&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here is where I am now&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;Sub CTRL254_5_OnClick(eventObj) &lt;/p&gt;
&lt;p&gt;Dim objOutlook Dim itmAppt &lt;/p&gt;
&lt;p&gt;Dim subj &lt;/p&gt;
&lt;p&gt;Dim datenode &lt;/p&gt;
&lt;p&gt;Set objOutlook = CreateObject(&amp;quot;Outlook.Application&amp;quot;) &lt;/p&gt;
&lt;p&gt;Set itmAppt = objOutlook.CreateItem(1) &lt;/p&gt;
&lt;p&gt;subj = InputBox(&amp;quot;Please enter a subject&amp;quot;) &lt;/p&gt;
&lt;p&gt;if subj = &amp;quot;&amp;quot; then exit sub &lt;/p&gt;
&lt;p&gt;set datenode = XDocument.DOM.selectSingleNode(&amp;quot;my:myFields/my:carelement/my:hirecarelement/my:Hirecar/my:hirecarstartdate&amp;quot;) &lt;/p&gt;
&lt;p&gt;itmAppt.Subject = subj &lt;/p&gt;
&lt;p&gt;itmAppt.Start = datenode.text &lt;/p&gt;
&lt;p&gt;itmAppt.Duration = 60 itm&lt;/p&gt;
&lt;p&gt;Appt.AllDayEvent = False &lt;/p&gt;
&lt;p&gt;itmAppt.ReminderSet = True &lt;/p&gt;
&lt;p&gt;itmAppt.ReminderMinutesBeforeStart = 30 &lt;/p&gt;
&lt;p&gt;itmAppt.Save &lt;/p&gt;
&lt;p&gt;End Sub&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;</description></item><item><title>Errors when trying to add to outlook calendar using form fields</title><link>https://www.infopathdev.com:443/forums/thread/75313.aspx</link><pubDate>Wed, 15 Feb 2012 18:19:54 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:75313</guid><dc:creator>socknose</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/75313.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=75313</wfw:commentRss><description>&lt;p&gt;Hi. I&amp;#39;ve been using this website as a guide for a number of problems and it has proved extremely useful. I&amp;#39;m currently trying to make it so that the user can click on a button and automatically have what they&amp;#39;ve entered added into their outlook calendar. It all works fine until I start trying to reference the fields on the form. This is what I have currently&lt;/p&gt;
&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;Sub CTRL237_5_OnClick(eventObj) &lt;/p&gt;
&lt;p&gt;Dim objOutlook &lt;/p&gt;
&lt;p&gt;Dim itmAppt &lt;/p&gt;
&lt;p&gt;Dim subj&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Dim datenode &lt;/p&gt;
&lt;p&gt;Set objOutlook = CreateObject(&amp;quot;Outlook.Application&amp;quot;) &lt;/p&gt;
&lt;p&gt;Set itmAppt = objOutlook.CreateItem(1) &lt;/p&gt;
&lt;p&gt;subj = InputBox(&amp;quot;Please enter a subject&amp;quot;) &lt;/p&gt;
&lt;p&gt;if subj = &amp;quot;&amp;quot; then exit sub &lt;/p&gt;
&lt;p&gt;set datenode = XDocument.DOM.selectSingleNode(&amp;quot;/my:myFields/my:hirecarstartdate&amp;quot;) &lt;/p&gt;
&lt;p&gt;itmAppt.Subject = subj &lt;/p&gt;
&lt;p&gt;itmAppt.Start = datenode.text &lt;/p&gt;
&lt;p&gt;itmAppt.Duration = 60 itmAppt.&lt;/p&gt;
&lt;p&gt;AllDayEvent = False &lt;/p&gt;
&lt;p&gt;itmAppt.ReminderSet = True &lt;/p&gt;
&lt;p&gt;itmAppt.ReminderMinutesBeforeStart = 30 &lt;/p&gt;
&lt;p&gt;itmAppt.Save&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When I try to run that I get the following error.&lt;/p&gt;
&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;Object required: &amp;#39;datenode&amp;#39;&lt;br /&gt;File:script.vbs&lt;br /&gt;Line:38&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;
&lt;p&gt;When I remove the .text from the end of Line38 I get this:&lt;/p&gt;
&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;The following error occurred:&lt;/p&gt;
&lt;p&gt;Type Mismatch: Unable to coerce parameter value. Outlook cannot translate your string.&lt;br /&gt;File:script.vbs&lt;br /&gt;Line:38&lt;/p&gt;
&lt;p&gt;Type mismatch.&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;
&lt;p&gt;Can anyone help me? I&amp;#39;m close to pulling my hair out and just making the user fill out the fields as well as an input box!&lt;/p&gt;</description></item></channel></rss>