Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Outlook and VB Read and write appointments

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
By default Outlook 2016 displays only one time zone in the Calendar. The following article explains how to display two time zones in one calendar view.
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…
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: …

670 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