Winscripter
  WSH
  Forums
  Downloads
  Books
  Links
  Amazon




Login
Register

© winscripter.com
1998-2004







Script: Outlook - Add a Task

Posted by on Sunday, January 18, 2004 (PST)

Script: Add a task to Outlook.

 

/**
 * Script:   addOlTask.js
 * Purpose:  Add a task to Outlook
 * Author:   Daren Thiel
 * Date:     19 April 1999
 * Web:     
http://www.winscripter.com
 * Comments: This is a very basic example of creating
 *           a task item in Outlook.  Many additional
 *           properties can be set that are not covered.
 *
 * Notes:    This example assumes that either
 *           1. a session of Outlook is running (or)
 *           2. The user is not prompted for a profile
 **/
 

/* Define Outlook constant for Task Item */
var olTaskItem = 3;
/* Create an instance of Outlook */
ol = new ActiveXObject( "Outlook.Application" );
/* Create a Task Item */
task = ol.CreateItem( olTaskItem );
/* Set some properties of the task */
task.Subject = "Hello World Task";
task.DueDate = "1/1/99";
task.DateCompleted = "1/2/99";
/* Save the Task */
task.Save();
/* Tell the user we are done! */
WScript.Echo( "Done" );
 

Comments:

...how to run this script without starting Outlook...?
By Oklino on Tuesday, April 26, 2005 (PST)

does anybody know, how to make this script work if Outlook is not act. running? (not startet)

 

 



WSH and ADSI Administrative Scripting

New Articles
  • List installed COM objects and associated ProgIDs
    Script: Lists all COM Objects and their associated ProgIDs (If available). Win32_ClassicCOMClassSetting

  • Script: File Rotator
    Script: Rotate files where the most current file has the lowest number in the archive. When files exceed the retention period, they are deleted. Typically used for log files, backups, etc..

  • Script: Create IIS Website and DNS record
    Script: Dan Casier sent me this script that will create a website and appropriate DNS record. The script is intended for Windows 2000 Server with local DNS and necessary DNS mof installed.


  • Winscripter   |  WSH   |  Forums   |  Downloads   |  Books   |  Links   |  Amazon