Setting meeting times from custom form data

J

joshnya2

I have a custom form that has a [TextBox9] where I want the user to
input the current date ex: 06/01/2007

On click the form will send out a bunch of meeting requests but I am
having a hard time getting a customized date to work.

If I want a meeting for the date the person entered + 1 day from 7:00
AM to 4:00 PM how would I do that?

The following code works for hard coding a date into the macro:

Set objOL = CreateObject("Outlook.Application")
Set objAppt = objOL.CreateItem(olAppointmentItem)
With objAppt
.Subject = "My Test Appointment"
.start = "06/01/2007 7:00 AM"
.End = "06/01/2007 4:00 PM"

' make it a meeting request
.MeetingStatus = olMeeting
.RequiredAttendees = [TextBox1]
.Send
End With


What I am trying to do is at the start and end do something like:
Again, TextBox9 is the mm/dd/yyy string pulled from that field on my
form.

..start = [TextBox9] + 1 & "7:00 AM"
..End = [TextBox9] + 1 & "4:00 PM"


So if the user entered the date "06/02/2007" into my field associated
with TextBox9 a meeting would be generated for 06/03/2007 from 7am to
4pm.

hewp..
 
S

Sue Mosher [MVP-Outlook]

TextBox9 sounds like a control name, not a property name. The two use completely different syntaxes. See http://www.outlookcode.com/article.aspx?ID=38
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
J

joshnya2

TextBox9 is a control. If you look at the bottom of my code snippet
you will see I used it to set the attendee of the meeting request that
gets generated. It is also a control. I read the article you linked
and I was wonderinf ig there was a way to set the date/time on my
meeting invite using the control syntax and not the property syntax.

Thanks for your input, it's really helpful!

TextBox9 sounds like a control name, not a property name. The two use completely different syntaxes. Seehttp://www.outlookcode.com/article.aspx?ID=38
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers




joshnya2 said:
I have a custom form that has a [TextBox9] where I want the user to
input the current date ex: 06/01/2007
On click the form will send out a bunch of meeting requests but I am
having a hard time getting a customized date to work.
If I want a meeting for the date the person entered + 1 day from 7:00
AM to 4:00 PM how would I do that?
The following code works for hard coding a date into the macro:
Set objOL = CreateObject("Outlook.Application")
Set objAppt = objOL.CreateItem(olAppointmentItem)
With objAppt
.Subject = "My Test Appointment"
.start = "06/01/2007 7:00 AM"
.End = "06/01/2007 4:00 PM"
' make it a meeting request
.MeetingStatus = olMeeting
.RequiredAttendees = [TextBox1]
.Send
End With
What I am trying to do is at the start and end do something like:
Again, TextBox9 is the mm/dd/yyy string pulled from that field on my
form.
.start = [TextBox9] + 1 & "7:00 AM"
.End = [TextBox9] + 1 & "4:00 PM"
So if the user entered the date "06/02/2007" into my field associated
with TextBox9 a meeting would be generated for 06/03/2007 from 7am to
4pm.
hewp..- Hide quoted text -

- Show quoted text -
 
S

Sue Mosher [MVP-Outlook]

Get the value from the control, as shown on the page I suggested, then use that value to set the value of the date/time property on the meeting request. The CDate() function is useful for converting strings to date values.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


joshnya2 said:
TextBox9 is a control. If you look at the bottom of my code snippet
you will see I used it to set the attendee of the meeting request that
gets generated. It is also a control. I read the article you linked
and I was wonderinf ig there was a way to set the date/time on my
meeting invite using the control syntax and not the property syntax.

Thanks for your input, it's really helpful!

TextBox9 sounds like a control name, not a property name. The two use completely different syntaxes. See http://www.outlookcode.com/article.aspx?ID=38

joshnya2 said:
I have a custom form that has a [TextBox9] where I want the user to
input the current date ex: 06/01/2007
On click the form will send out a bunch of meeting requests but I am
having a hard time getting a customized date to work.
If I want a meeting for the date the person entered + 1 day from 7:00
AM to 4:00 PM how would I do that?
The following code works for hard coding a date into the macro:
Set objOL = CreateObject("Outlook.Application")
Set objAppt = objOL.CreateItem(olAppointmentItem)
With objAppt
.Subject = "My Test Appointment"
.start = "06/01/2007 7:00 AM"
.End = "06/01/2007 4:00 PM"
' make it a meeting request
.MeetingStatus = olMeeting
.RequiredAttendees = [TextBox1]
.Send
End With
What I am trying to do is at the start and end do something like:
Again, TextBox9 is the mm/dd/yyy string pulled from that field on my
form.
.start = [TextBox9] + 1 & "7:00 AM"
.End = [TextBox9] + 1 & "4:00 PM"
So if the user entered the date "06/02/2007" into my field associated
with TextBox9 a meeting would be generated for 06/03/2007 from 7am to
4pm.
hewp..- Hide quoted text -

- Show quoted text -
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top