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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access To Outlook

Status
Not open for further replies.

davethegog

Instructor
Oct 3, 2002
9
GB
I've set up an application in Access 97 which currently creates calender activities within Outlook 2000(as well as recording the date and time in Access). This works well.

What I'd now like to do is from access delete the activity from outlook, based upon the recorded date and time. Or alternatively reschedule the activity. Any suggestions.


Thanks in advance
 
this might help/start you off.
Code:
    Dim ol As Outlook.Application
    Dim olns As Outlook.NameSpace
    Dim objAllFolders As MAPIFolder
    Dim objFolder As MAPIFolder
    Dim objAllAppointments As Outlook.Items
    Dim appointment1 As Outlook.AppointmentItem
    Dim i As Integer

    'gets the right folder
    Set olns = ol.GetNamespace("MAPI")
    Set objAllFolders = olns.Folders("Mailbox - Stephen Connell")
    Set objFolder = objAllFolders.Folders("calendar")
    Set objAllAppointments = objFolder.Items

    'access the item and make changes
    Set appointment1 = objAllContacts.Item(i)
    appointment1.[Normalized subject]  ="new appointment text here"
appointment1.save

the tricky bit is to get the index for the Item in the line
Code:
 Set appointment1 = objAllContacts.Item(i)

how you do this?
I used something similar where I change an email address by looping through the items, confirming the first and last name and then when I get the right one change the details you want.

having linked the table the Item index starts at the last record and works up. the field names are;
Importance, Message Class, Priority, Subject, From, Message To Me, Message CC to Me, Sender Name, CC, To, Received, Message Size,Body, Creation Time, Last Modification Time, Subject Prefix,Has Attachments,Normalized Subject,Object Type,Content Unread.

Hope this helps in some way.
Steve.
 
thanks

I'd started heading in the same direction.

I've used the Restrict command to filter out the activities for the day and time and am currently working through the rest of the code.

Cheers

Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top