VBS: Ako scriptom vytvorit ulohu v Outlooku?

chrumky chrumky, toto som zhanal asi mesiac… nemam chut sa ucit cele kvaziobjektove modely atd. takze som nasiel skripty s prikladmi a tento staci uz len trolinku upravit a uz si mozem skriptami sadzat ulohy do outlookuuuuuuuuuuuuu


‚ Script To Create New Outlook Task
*
‚ Script To Create New Outlook Task *
‚ *
‚ This script will uses COM Automation to access *
‚ the Outlook Object Model in order to create a new *
‚ Task item. *
‚ *
‚ The user is prompted for the Task Subject and *
‚ Due Date. The code also contains a commented-out *
‚ section that could be enabled, which provides a *
‚ request for Body Text of the Task. *
‚ *
‚ Note that the CreateObject call uses the generic *
‚ reference, „Outlook.Application“ with no version *
‚ number. This assures that the script won’t break *
‚ just because the client machine doesn’t contain *
‚ the correct version of MS Outlook. The script *
‚ will break, however, if no version of Outlook is *
‚ found on the client machine *
‚ *
*
Dim objOutlook
Dim itmTask
Dim datDue
Dim strMsg
Const olTaskItem = 3
‚Create Outlook Object and Task Item
Set objOutlook = CreateObject(„Outlook.application“)
Set itmTask = objOutlook.CreateItem(olTaskItem)
‚Query the User for a Subject
itmTask.Subject = InputBox(„Enter the task subject:“, „Subject“)
‚OPTIONAL Query the user for the Body Text
‚NOTE: This is not enabled because it’s assumed that the user
‚ is interested in the shortest route to a new task.

‚ itmTask.Body = InputBox(„Enter the task body text:“, „Body“)
‚Handle case if/when user supplies no Subject.
‚Assume user is aborting his request to create a new task.
If Len(itmTask.Subject) = 0 Then
‚ User hit Cancel or didn’t type any text
‚ There is no task to save
strMsg = „No Task information provied.“ & vbcrlf & vbcrlf & „Operation aborted by user.“
MsgBox strMsg, ,“Aborted“
Else
‚Query user for Due Date
datDue = InputBox(„Enter the due date:“, „Due Date“,Date())
If datDue <> „“ Then
itmTask.DueDate = datDue
End if
itmTask.save
End If
‚Clean up
Set itmTask = Nothing
Set objOutlook = Nothing


Pouzivatel tejto siete je zrejme idiot, neviem co chcel dosiahnut pridanim komentarov bez normalneho obsahu.

Môže sa Vám ešte páčiť...