Consulting

Results 1 to 4 of 4

Thread: Extract current date from the Calendar

  1. #1

    Extract current date from the Calendar

    For the Calendar, what is the programmatic way to extract the current date and store it in a variable?

    I am developing a command to delete an appointment on the day that is currently displayed, based on time information the user provides at run time. But to make this work, I need a way to evaluate the value of AppDate:

    [vba]
    Dim outobj As Outlook.Application
    Dim outappt As Outlook.AppointmentItem

    Set outobj = CreateObject("outlook.application")
    Set outappt = outobj.CreateItem(olAppointmentItem)

    Let AppDate = [???]

    AppTime = [provided by user, e.g., "11:22 AM"]

    With outappt
    .Start = AppDate & " " & AppTime
    .Delete
    End With

    ' Release the Outlook object variable...
    Set outobj = Nothing
    [/vba]

    If there is a better way to do this, I'm interested!

  2. #2
    Moderator VBAX Master geekgirlau's Avatar
    Joined
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    1,464
    Location

  3. #3
    Is this really true? (From the Description):

    "Outlook provides no direct way to read the time block [I assume this also means the date, which is what I am looking for] the user may have selected in a calendar folder."

  4. #4
    VBAX Expert JP2112's Avatar
    Joined
    Oct 2008
    Location
    Astoria, NY
    Posts
    590
    Location
    Makes sense. A tool like Outlook Spy might provide more insight.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •