Solved

Outlook and VB Read and write appointments

Posted on 2001-06-19
4
180 Views
Last Modified: 2010-04-08
I want to make a VB program where I can read and write appointments in my colleagues calendar.  How do I do this?  Pls. send complete code examples or links.

The VB program will be called from another application.  

Brgds

Nicolas


0
Comment
Question by:nicolas_image
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
rjcpjc earned 200 total points
ID: 6207391
Here's some sample code for getting another user's task folder and manipulating the items in it:  


Set myNameSpace = Application.GetNameSpace("MAPI")
          Set myRecipient = myNameSpace.CreateRecipient("Test, Rep")
          myRecipient.Resolve
          If myRecipient.Resolved Then
               Set MyTaskFolder = myNameSpace.GetSharedDefaultFolder(myRecipient, 13)
          End If
          Set myTaskItem = MyTaskFolder.Items.Add()
          If Item.GetInspector.ModifiedFormPages("Contact").Controls("DateRemind") <> Date() + 30 then
               tmpDate = Item.GetInspector.ModifiedFormPages("Contact").Controls("DateRemind")
          else
               tmpDate = Date() + Item.UserProperties("NumberDays").Value
          End If
          If Weekday(tmpDate) = 7 then
               tmpDate = tmpDate + 2
          else
               If Weekday(tmpDate) = 1 then
                    tmpDate = tmpDate + 1
               end if
          end if
          myTaskItem.DueDate = tmpDate
          myTaskItem.Subject = "Contact " & Item.UserProperties("ctcFullName").Value & " at " & Item.UserProperties("ctcCompany").Value
          myTaskItem.ReminderSet = -1
          myTaskItem.Close 0


The calendar folder works similarly:  Just replace the 13 in GetSharedDefaultFolder with 9 for olFolderCalendar.

To use VB to work with Outlook, you first have to go into the references and add a reference to the Outlook Object Library.  

I hope I've helped a little bit.  Post back with some more specific questions and I'll try to help some more.
0
 
LVL 9

Expert Comment

by:rjcpjc
ID: 6263685
Nicolas,

Did my comment help you at all?  If so please accept it as an answer.  if not please post back so that I or another expert can help some more.

If you need more information, please post back.  

--PatriciaC
0
 

Author Comment

by:nicolas_image
ID: 6264089
I'm sorry it took so long time!
0
 

Author Comment

by:nicolas_image
ID: 6279815
Hi Patricia

I have a new question posted, if you could help me here.  Subject:
Add homemade buttons to standard toolbar
0

Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Changing a few Outlook Options can help keep you organized!
This article will help to fix the below errors for MS Exchange Server 2013 I. Certificate error "name on the security certificate is invalid or does not match the name of the site" II. Out of Office not working III. Make Internal URLs and Externa…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question