PDA

View Full Version : Extract current date from the Calendar



acantor
10-21-2009, 07:59 PM
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:


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


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

geekgirlau
10-21-2009, 11:20 PM
This might help ...

http://www.outlookcode.com/codedetail.aspx?id=616

acantor
10-22-2009, 06:32 AM
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."

JP2112
10-22-2009, 07:07 AM
Makes sense. A tool like Outlook Spy (http://www.dimastr.com/outspy/) might provide more insight.