-
Notifications
You must be signed in to change notification settings - Fork 0
/
scratch.wsf
48 lines (45 loc) · 1.31 KB
/
scratch.wsf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?xml version="1.0" encoding="iso-8859-1"?>
<package>
<job id="getMessage">
<runtime>
<description>
This script gets a Message from an open Outlook window
</description>
</runtime>
<script language="JScript">
try {
var app = new ActiveXObject("Outlook.Application");
var inspector = app.ActiveInspector;
// Reminder
if (inspector == null) {
WScript.StdOut.Write("You haven't opened the message up for Reply...");
WScript.Quit(1);
}
WScript.StdOut.Write(inspector.CurrentItem.Body);
} catch (e) {
WScript.Echo("Error: " + e)
}
</script>
</job>
<job id="putMessage">
<runtime>
<description>
This script puts the content of StdIn back into an open Outlook
window.
</description>
</runtime>
<script language="JScript">
try {
var stdin = WScript.StdIn;
var app = new ActiveXObject("Outlook.Application");
var inspector = app.ActiveInspector;
var body = stdin.ReadAll();
inspector.CurrentItem.Body= body;
inspector.display();
inspector.Activate();
} catch (e) {
WScript.Echo("Error: " + e)
}
</script>
</job>
</package>