Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / May 2007

Tip: Looking for answers? Try searching our database.

Setting meeting times from custom form data

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
joshnya2 - 29 May 2007 20:00 GMT
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..
Sue Mosher [MVP-Outlook] - 29 May 2007 23:29 GMT
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
Signature

Sue Mosher, Outlook MVP
  Author of Configuring Microsoft Outlook 2003
    http://www.turtleflock.com/olconfig/index.htm
  and Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx
 

>I have a custom form that has a [TextBox9] where I want the user to
> input the current date ex: 06/01/2007
[quoted text clipped - 32 lines]
>
> hewp..
joshnya2 - 30 May 2007 03:33 GMT
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!

On May 29, 5:29 pm, "Sue Mosher [MVP-Outlook]"
<sue...@outlookcode.com> wrote:
> TextBox9 sounds like a control name, not a property name. The two use completely different syntaxes. Seehttp://www.outlookcode.com/article.aspx?ID=38
> --
[quoted text clipped - 43 lines]
>
> - Show quoted text -
Sue Mosher [MVP-Outlook] - 30 May 2007 12:49 GMT
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.

Signature

Sue Mosher, Outlook MVP
  Author of Configuring Microsoft Outlook 2003
    http://www.turtleflock.com/olconfig/index.htm
  and Microsoft Outlook Programming - Jumpstart for
    Administrators, Power Users, and Developers
    http://www.outlookcode.com/jumpstart.aspx
 

> 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
[quoted text clipped - 46 lines]
>>
>> - Show quoted text -
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.