Microsoft Knowledge Base Email Alertz

KBAlertz.com: (162371) - This article shows you how to use Automation to add a task or a reminder to Microsoft Outlook. This article assumes that you are familiar with Visual Basic for Applications and with creating Microsoft Access applications using the programming tools...

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]

Search KbAlertz

Advanced Search

Webmasters
Put kbAlertz on your website.
[ Click Here for more! ]





ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **


Bug Tracking Software
For bug tracking software or defect tracking software or issue tracking software, visit Axosoft.


Community Site



We Send hundreds of thousands of emails using ASP.NET Email



Expert Web Design & Graphic Design
Design44.com

ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **




Mentioned In








Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks




Article ID: 162371 - Last Review: January 19, 2007 - Revision: 3.3

ACC: Using Automation to Add a Task/Reminder to MS Outlook

This article was previously published under Q162371
Advanced: Requires expert coding, interoperability, and multiuser skills.

SUMMARY

This article shows you how to use Automation to add a task or a reminder to Microsoft Outlook.

This article assumes that you are familiar with Visual Basic for Applications and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information about Visual Basic for Applications, please refer to your version of the "Building Applications with Microsoft Access" manual.

There may be times when you would like to programmatically add a task or a reminder to Outlook from Microsoft Access. This article provides sample code that enables you to create a task and play a .wav file as a reminder.

NOTE: You must point the .ReminderSoundFile property to a valid sound file on your hard drive.

MORE INFORMATION

To add a task or a reminder to Microsoft Outlook, follow these steps:
  1. Start Microsoft Access and open the sample database Northwind.mdb.
  2. Create a module and type the following line in the Declarations section if it is not already there:
    Option Explicit
    					
  3. On the Tools menu, click References.
  4. Click Microsoft Outlook 8.0 Object Library in the Available References box.

    NOTE: If this object library is not available in the References list, click Browse to locate the Msoutl8.olb file, which is installed by default in the C:\Program Files\Microsoft Office\Office folder.
  5. Type the following procedure:
          Function AddOutLookTask()
             Dim appOutLook As Outlook.Application
             Dim taskOutLook As Outlook.TaskItem
             Set appOutLook = CreateObject("Outlook.Application")
             Set taskOutLook = appOutLook.CreateItem(olTaskItem)
          With taskOutLook
              .Subject = "This is the subject of my task"
              .Body = "This is the body of my task."
              .ReminderSet = True
              .ReminderTime = DateAdd("n", 2, Now)  ' Set to remind us 2
                                                    ' minutes from now.
              .DueDate = DateAdd("n", 5, Now)       ' Set the due date to
                                                    ' 5 minutes from now.
              .ReminderPlaySound = True
               'add the path to a .wav file on your computer.
              .ReminderSoundFile = "C:\Win95\media\ding.wav"
              .Save
          End With
         End Function
    					
  6. To test this function, type the following line in the Debug window, and then press ENTER:
    ?AddOutLookTask()
    						
    Note that a new task is added to Microsoft Outlook.

REFERENCES

For additional information about using Automation to add appointments to Microsoft Outlook, please see the following article in the Microsoft Knowledge Base:
160502  (http://kbalertz.com/Feedback.aspx?kbNumber=160502/EN-US/ ) ACC: Using Automation to Add Appointments to Microsoft Outlook
For additional information about Automation theory and multiple examples on automating all the Office 97 products, click the article number below to view the article in the Microsoft Knowledge Base:
167223  (http://kbalertz.com/Feedback.aspx?kbNumber=167223/EN-US/ ) OFF97: Microsoft Office 97 Automation Help File Available
For additional information about using Automation with Microsoft Access, search the Help Index for "Automation," or ask the Microsoft Access 97 Office Assistant.

APPLIES TO
  • Microsoft Access 95 Standard Edition
  • Microsoft Access 97 Standard Edition
Keywords: 
kbfaq kbinfo kbprogramming KB162371
Retired KB ArticleRetired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate

Jimit Shah - jimitshah05 NOSPAM-AT-NOSPAM yahoo.co.in Report As Irrelevant  
Written: 6/28/2005 3:17 AM
can you plz send me a code for addind task in outlook using visual basic 6.0.

(Optional) Name

(Optional) Public URL Or Email

Comments
No HTML -- Text Only Please