2006/2/24, GTD Wannabe <gtdwa...@gmail.com>:
>
> Someone's already posted a comment to my blog post [1] about this. In
> it, they show how they use exactly one magicword "@" and make the
> context part of the parameter. So they would enter
>
> @ CODE - implement foobar widget
>
> to get
>
> @CODE - implement foobar widget
>
> A couple of more characters on the input side, but saves you from
> having to create multiple magic words. I thought it was an elegant
> refinement. Note: to try it, I had to name my magicword @@, probably
> because there was no way to make @ unique with the other magicwords.
>
> [1] http://gtdwannabe.blogspot.com/
>
The script follows (just cut and paste onto notepad and save as "@.vbs"):
'@.vbs
'first argument is context, it gets saved on the categories field of the task
'the other arguments are the subject of the task
'if no arguments or only the context are passed, the task form is displayed
'otherwise the task is silently created
Dim S
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(3)
Set myArgs = WScript.Arguments
if myArgs.Count > 0 then
myItem.Categories = "@" + myArgs(0)
if myArgs.Count > 1 then
S = ""
For i = 1 to myArgs.Count-1
S = S + " " + myArgs(i)
Next
myItem.Subject = S
myItem.Save
End if
End if
if myArgs.Count < 2 then myItem.Display
'end @.vbs
Slickrun setup:
MagicWord: @
Filename: @.vbs
Startup Path: <where you saved @.vbs>
Usage:
@ [CONTEXT] [NEXT ACTION]
Note the space after @. No quotes are necessary unless the context
has more than one word.
HTH
Regards
--
Marco V. Rodríguez Vargas
For this specific case, the easiest way is:
1. Select from the line that says '@.vbs to the line that says 'end @.vbs
2. Copy the selection (Ctrl-C)
3. Open Notepad
4. Paste the selection (Ctrl-V)
5. Save the Notepad File as "@.vbs" and note the location where it was saved.
Please note that this need that the Windows Scripting Host be
available, this is normally installed with Windows but some business's
IT staff may disable it for security reasons.
HTH, Marco
2006/3/3, Helmut Granda <gra...@gmail.com>:
Outlook is unaware of this script, it only responds to "someone"
asking it to create a task. The objective of the script is to create
a task from the command prompt since this is the way SlickRun needs
it.
IOW, the functionality of calling Outlook from a script is built in in
Outlook, in fact in the whole MS Office. BTW I tested this only in
Outlook 2003; the Office Automation documentation I used to find the
commands referred to OL 2000 so it should work from that version on,
it *might* work on older versions.
Regards, Marco.
2006/3/3, Helmut Granda <gra...@gmail.com>:
Wonderful job, Marco! +3 GTD
- Bryan
Regards, Marco.
Line:7 Char:1 Error: The specified module could not be found. Code:
8007007E. Source: (null)
I have Oulook 2003 installed as well as WSH 5.5.
Could you send me your vbs file offlist to marcovrv<at>gmail.com to
take a look of what is in your seventh line?
Regards, Marco.
2006/3/6, jack <jack...@gmail.com>:
Set myOlApp = CreateObject("Outlook.Application")
To...
Set myOlApp = CreateObject("Outlook.Application","localhost")
Works like a charm now
Is there a good online reference for interacting with Outlook via the
WSH? I've rewritten part of the original post with the intent of
adding the due date as well, but I'd love to see what else is
possible.
I have four different magic words setup in Slickrun which create a new
calendar entry, a new task, a new mail or a new note.
All you have to do in Slickrun is setup the program as the normal
outlook.exe file (in may case it's C:\PROGRAM FILES\MICROSOFT
OFFICE\OFFICE11\OUTLOOK.EXE ) and in the parameters box enter one of the
following:
/c ipm.apppointment
/c ipm.note
/c ipm.task
ipm.appointment is for calendar
ipm.note is for a new email
ipm.task is for a new task
Nothing is pre-filled but it's quick and works.
Kind regards,
Paul Broadwith MBCS
Blue Ivy Ltd
Tel.: 0800 612 0601
Messenger: paul.br...@blueivy.co.uk
Web: http://www.blueivy.co.uk
Find out if you could save money over your current broadband provider by going to http://www.whatsthepigfor.info/broadband
For other low cost utility services go to http://www.whatsthepigfor.info
Blue Ivy Limited is an Authorised Distributor of The Utility Warehouse Discount Club.
Here's a good starting point.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_2003_ta/html/odc_landoffice03_vba.asp
If you have time to post your change to the script in order to get the
due date that would be great.
Thanks for the pointer... That'll give me something to snoop through tomorrow.
> If you have time to post your change to the script in order to get the
> due date that would be great.
Here is the modified script I'm using. The functionality is changed
slightly, mainly to make it easy to determine if there is a date
included. To that end, this version requires that the subject field
be enclosed in double-quotes so that the script sees it as one
argument. As in the original version, entering either an '@' alone,
or an @ and a category with no subject will display a Task form.
Including a subject and (optionally) a date will cause it to be
silently added (no popup). An entry now looks like:
@ Phone "Call Jack and ask for better pricing" 2006-03-08
Unfortunately, when using this method it seems that one is not able to
use the today/tomorrow/Wednesday shorthand available in Outlook
directly.
'@.vbs
'first argument is context, it gets saved on the categories field of the task
'the other arguments are the subject of the task
'if no arguments or only the context are passed, the task form is displayed
'otherwise the task is silently created
' SWS Modifications: Added DueDate, modified subject entry method
' Usage: @ [Category] ["subject"] [date]
'
Dim S
Dim D
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(3)
Set myArgs = WScript.Arguments
if myArgs.Count > 0 then
myItem.Categories = "@" + myArgs(0)
if myArgs.Count > 1 then
myItem.Subject = myArgs(1)
if myArgs.Count > 2 Then
myItem.DueDate = myArgs(2)
End If
myItem.Save
End if
End if
if myArgs.Count < 2 then myItem.Display
'end @.vbs
SWS