|
-
Jun 23rd, 2005, 03:37 AM
#1
Thread Starter
Junior Member
running an executable (to lock workstation) from Outlook script
How can I run an executable or lock the workstation from Outlook script ?
Last edited by snir; Jun 23rd, 2005 at 04:37 AM.
-
Jun 23rd, 2005, 04:53 AM
#2
Re: running an executable (to lock workstation) from Outlook script
by outlook script, do you mean vba?
if so you can use the shell function
RetVal = Shell("C:\WINDOWS\CALC.EXE", 1)
pete
-
Jun 23rd, 2005, 05:08 AM
#3
Thread Starter
Junior Member
Re: running an executable (to lock workstation) from Outlook script
I get the error :"Type mismatch: 'shell' "
-
Jun 23rd, 2005, 05:22 AM
#4
Re: running an executable (to lock workstation) from Outlook script
-
Jun 23rd, 2005, 05:31 AM
#5
Thread Starter
Junior Member
Re: running an executable (to lock workstation) from Outlook script
VB Code:
Function Item_CustomAction(ByVal MyAction,ByVal Response)Select Case MyAction.Name
Case "Approve"
RetVal = Shell("C:\WINNT\system32\rundll32 user32.dll,LockWorkStation", 1)
Msgbox "Test"
End Select
End Function
-
Jun 23rd, 2005, 05:53 AM
#6
Re: running an executable (to lock workstation) from Outlook script
user32 is not an executable, you will need to use an api call, here is a sample from allapi
Private Declare Function LockWorkStation Lib "user32.dll" () As Long
Private Sub Form_Load()
'KPD-Team 2000
'URL: http://www.allapi.net/
'E-Mail: [email protected]
LockWorkStation
End Sub
the first line has to go in the general area of the code at the top
pete
-
Jun 23rd, 2005, 05:59 AM
#7
Thread Starter
Junior Member
Re: running an executable (to lock workstation) from Outlook script
I tried these and I get the error:"expected end of statement" on the first line.
I have to mention that the script editor I have in the Outlook looks like a notepad.
-
Jun 23rd, 2005, 07:09 AM
#8
Re: running an executable (to lock workstation) from Outlook script
yeah it looks like it is vb script so i don't know if you can, i would have thought you would have vba. in outlook under tools do you have macros, if so you can go into the visual basic editor there
pete
-
Jun 23rd, 2005, 08:01 AM
#9
Thread Starter
Junior Member
Re: running an executable (to lock workstation) from Outlook script
o.k. I can open the editor, but how do I generate here events according to the happening in the form, like I did with Item_CustomAction .
It looks like the Outlook form responds to the simple script editor.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|