Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Outlook and VB Read and write appointments

Posted on 2001-06-19
4
Medium Priority
?
186 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 800 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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

In this article I discuss my selections of the Top Four free Outlook OST File Viewers available. Open, view and read even damaged OST files by using these tools. They all provide a clear preview of all data such as emails, notes, tasks, calendars, e…
There can be many situations demanding the conversion of Outlook OST files to PST format and as such, there is no shortage of automated tools to perform this conversion. However, what makes Stellar OST to PST converter stand above the rest? Let us e…
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

926 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