Hello all!
Currently, I have a working script for a help desk that asks for a ticket number, subject, and how long until it should remind you. When it attaches the ticket to the task, it attaches a shortcut, as opposed to a copy of the file. Can anyone tell me how to make it copy the file, so the files don't build up in a temp folder?
Also, any good recommendations on fixing the date side? Right now, you have to put in how many minutes to remind you, so if it is 24 hours, they have to say 1440 minutes.
Here is the current script.
(keep in mind i have altered the query boxes so it sets a value instead of asking for testing purposes)
any help would be supurb!!
Thanks in advance!!
Thank you!!!
Mike Kovacic
Currently, I have a working script for a help desk that asks for a ticket number, subject, and how long until it should remind you. When it attaches the ticket to the task, it attaches a shortcut, as opposed to a copy of the file. Can anyone tell me how to make it copy the file, so the files don't build up in a temp folder?
Also, any good recommendations on fixing the date side? Right now, you have to put in how many minutes to remind you, so if it is 24 hours, they have to say 1440 minutes.
Here is the current script.
(keep in mind i have altered the query boxes so it sets a value instead of asking for testing purposes)
Code:
Option Explicit
Dim objFSO, objFolder, objShell, strDirectory,WshShell,iklogname,subject,when,remedyticket,OlApp,nsNameSpace,olFolderCalendar,olEvent,olByValue
strDirectory = "c:\remtemp"
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists(strDirectory) Then
Set objFolder = objFSO.GetFolder(strDirectory)
else
Set objFolder = objFSO.CreateFolder(strDirectory)
end if
Set WshShell = WScript.CreateObject("WScript.Shell")
iklogname = "01234567"
If iklogname = "" Then
MsgBox ("I can not create a reminder if you don't give me a ticket number.")
Wscript.Quit 1
Else
subject = "attachment test"
when = "1"
If when = "" Then
MsgBox ("This is required!")
when = Inputbox("how many minutes until I should remind you? [1440 is 24 hours]" , "Remind me in...")
Else
DIM fso, GuyFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set remedyticket = fso.CreateTextFile( "C:\remtemp\RemedyTicket " & iklogname & ".ARTask", True)
remedyticket.WriteLine("[Shortcut]")
remedyticket.WriteLine ("Name = HPD:HelpDesk")
remedyticket.WriteLine ("Type = 0")
remedyticket.WriteLine ("Server = my.remedy.server")
remedyticket.WriteLine ("Join = 0")
remedyticket.WriteLine ("Ticket = 00000000" & iklogname)
remedyticket.Close
END IF
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:\remtemp\RemedyTicket " & iklogname & ".ARTask", _
olByValue, 1, "Test"
olEvent.Save
MsgBox ("The event has been created in your Outlook calendar. Should you need to cancel or change your reminder, it must be done through outlook.")
END IF
any help would be supurb!!
Thanks in advance!!
Thank you!!!
Mike Kovacic