Solved

Outlook and VB Read and write appointments

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Outlook Free & Paid Tools
Are you unable to connect or configure Hotmail email account in Microsoft Outlook 2010, 2007? Or Outlook.com emails are not downloading to Outlook? Lets’ see the problem and resolve Outlook Connector error syncing folder hierarchy (0x8004102A).
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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 …

770 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