Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

script attaching files in outlook task, shortcut / actual file

Status
Not open for further replies.

MrKovacic

IS-IT--Management
Nov 5, 2002
213
US
Hello...
I have been able to assemble a script that attaches a file sitting on the C:\temp directory into a task. The only problem is, it is attaching a shortcut instead of the actual file. I was hoping to change that to the actual file.. here is the code im using..

Code:
Set OlApp = CreateObject("Outlook.Application")
Set nsNameSpace = OlApp.GetNamespace("MAPI")
Set olFolderCalendar = nsNameSpace.GetDefaultFolder(9) 'olFolderCalendar
Set olEvent = OlApp.CreateItem(1) 'olAppointmentItem
olEvent.Start = DateAdd("n", when, Now())
olEvent.Subject = subject
olEvent.ReminderSet = True
olEvent.ReminderMinutesBeforeStart = 1
olEvent.Attachments.Add "C:\temp\RemedyTicket " & iklogname & ".ARTask", _
olByValue, 1, "Test"
olEvent.Save
MsgBox ("Event created in your Outlook calendar for " & when & " minutes from now..")

Where did I goof?




Thanks in advance!!

Thank you!!!

Mike Kovacic
 
Have you said anywhere what olByValue is equal to?
 
Tip: use the Option Explicit instruction.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top