Hi Please Help
I have started with the Infopath 2007 travel request sample. I have added a button to my form. I have successfully added visual basic code to the button so that when it is clicked then an Outlook Meeting Request is created and sent. However I want to for example reference the starting date of the Outlook meeting request to the starting date on the travel form. But I don't see anywhere a reference in the VB window to my list of fields on my Infopath form. I tried the me. without success. Do I need to add a data source or import source or reference in my VB window? My code is below. (I want to reference the agendaMeeting.Start = to an existing field on the Infopath form)
Thanks for your help with this.
Imports
Microsoft.Office.InfoPath
Imports
Template3
Imports
System
Imports
System.Xml
Imports
System.Xml.XPath
Imports
Outlook = Microsoft.Office.Interop.OutlookNamespace Template3
Public Class FormCode
' Member variables are not supported in browser-enabled forms.
' Instead, write and read these values from the FormState
' dictionary using code such as the following:
'
' Private Property _memberVariable() As Object
' Get
' _memberVariable = FormState("_memberVariable")
' End Get
' Set
' FormState("_memberVariable") = value
' End Set
' End Property
' NOTE: The following procedure is required by Microsoft Office InfoPath.
' It can be modified using Microsoft Office InfoPath.Private Sub InternalStartup(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Startup
AddHandler DirectCast(EventManager.ControlEvents("CTRL60_5"), ButtonEvent).Clicked, AddressOf CTRL60_5_Clicked
End SubPublic Sub CTRL60_5_Clicked(ByVal sender As Object, ByVal e As ClickedEventArgs)
Dim OutlookApp As New Outlook.ApplicationDim agendaMeeting As Outlook.AppointmentItem = CType(OutlookApp.CreateItem(Outlook.OlItemType.olAppointmentItem), Outlook.AppointmentItem)
If agendaMeeting IsNot Nothing Then
agendaMeeting.MeetingStatus = Outlook.OlMeetingStatus.olMeeting
agendaMeeting.Location =
"Conference Room"
agendaMeeting.Subject =
"Leave Application"
agendaMeeting.Body =
me."Let's get together to discuss the Leave Application"
agendaMeeting.Start = #11/23/2008 10:00:00 AM#
agendaMeeting.End = #11/23/2008 11:00:00 AM#
agendaMeeting.Duration = 60
Dim recipient As Outlook.Recipient = agendaMeeting.Recipients.Add("James Wellington")
recipient.Type = Outlook.OlMeetingRecipientType.olRequired
agendaMeeting.Display()
End If
End SubProtected Overrides Sub Finalize()
MyBase.Finalize()
End SubEnd Class
End
Namespace