Can InfoPath (2003 SP1) add an event in Outlook Calendar? - InfoPath Dev
in

InfoPath Dev

Can InfoPath (2003 SP1) add an event in Outlook Calendar?

Last post 11-02-2009 06:43 AM by sheep. 32 replies.
Page 3 of 3 (33 items) < Previous 1 2 3
Sort Posts: Previous Next
  • 10-26-2009 07:01 AM In reply to

    • sheep
    • Not Ranked
    • Joined on 10-24-2009
    • Posts 7

    Re: Can InfoPath (2003 SP1) add an event in Outlook Calendar?

    but how ?

  • 10-29-2009 12:53 PM In reply to

    Re: Can InfoPath (2003 SP1) add an event in Outlook Calendar?

    Well, there are many ways to do that, but here is how I did it.  First you have to get the value from the field and define it as a string. The red text is the xpath to the field that contains the information that you want to be the subject - yours will be different than mine. 

    //Subject

    XPathNavigator SubjectField1 = MainDataSource.CreateNavigator().SelectSingleNode("/dfs:myFields/dfs:dataFields/d:Buyers/d:WorkOrders/@WorkOrderType", NamespaceManager);

    string SubjectSeed1 = SubjectField1.Value;

    Then assign that string to the myAppointment.Subject object like this:

    myAppointment.Subject = (SubjectSeed1);

    Fishman
  • 11-02-2009 06:43 AM In reply to

    • sheep
    • Not Ranked
    • Joined on 10-24-2009
    • Posts 7

    Re: Can InfoPath (2003 SP1) add an event in Outlook Calendar?

    Thank you!

    Unfortunaly a error occurt. Run Time Error     |      object demans: 'Main DataSource'

    Can you tell me what I am doing wrong?

    --- below the code

    Sub CTRL59_7_OnClick(eventObj) 

    Dim dateIndex, timeIndex, descriptionIndex, duration, reminderTime 
    Dim eventDate(), eventTime(), eventDescription(), i 
    Dim objOutlook 
    Dim myItem 
    Dim SubjectField1

    Set objOutlook = CreateObject("Outlook.Application") 
    Set myItem = objOutlook.CreateItem(1)

    SubjectField1 = MainDataSource.CreateNavigator().SelectSingleNode("/dfs:myFields/dfs:dataFields/d:Klanten/@Klantnummer", NamespaceManager) 
    string SubjectSeed1 = SubjectField1.Value 

    myItem.MeetingStatus = 1 
    myItem.Subject = SubjectSeed1 
    myItem.Location = "B" 
    myItem.Start = #10/1/2009 1:30:00 PM# 
    myItem.Duration = 60 
    myItem.Send

    End Sub

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