Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Infopath VB to fill textbox

Status
Not open for further replies.

msnook

Technical User
Jul 6, 2007
41
US
I am using VB to submit info from an Infopath form to my Outlook calendar but I am hung up on the coding needed to enter a value into a textbox located on the form itself. Any assistance in this area would be greatly appreciated.

Mike
 
Hi,

ANY code?

Have you assigned an Outlook Application Object?

Have you checked MS on the code exmples?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
The code I have so far is:

XDocument.DOM.setProperty "SelectionNamespaces", "xmlns:xsi="" xmlns:my="" xmlns:xd=""'</namespacesDefinition>

Sub CTRL21_5_OnClick(eventObj)

Dim objOutlook
Dim itmAppt
Dim time
Dim name

Set objOutlook = CreateObject("Outlook.Application")
Set itmAppt = objOutlook.CreateItem(1)
Set time = XDocument.DOM.selectSingleNode("/my:myFields/my:contact-data")
Set name = XDocument.DOM.selectSingleNode("/my:myFields/my:NPI-num")

itmAppt.Subject = name.text
itmAppt.Start = time.text
itmAppt.Duration = 15
itmAppt.AllDayEvent = False
itmAppt.ReminderSet = True
itmAppt.ReminderMinutesBeforeStart = 15
itmAppt.Save

End Sub

This works well when by itself and adds an appointment to my calendar. I am trying to set up so that same button does this and submits the data to a SharePoint library. What I have found is that if I set up a rule on the same button the code doesn't work. To work around that I was trying write code that would change the contents of a textbox within the form to "1" and then set up a rule on the textbox that when the contents became "1" it would submit the data.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top