Solved

Outlook and VB Read and write appointments

Posted on 2001-06-19
4
172 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
  • 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Use email signature images to promote corporate certifications and industry awards.
Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now