Beste mede tweakers,
Ik wil een script maken om op basis van gegevens uit de active directory een handtekening te maken, hiervoor heb ik onderstaande gemaakt op basis van http://community.spicewor...ectory-information?page=1
Probleem is nu echter dat de signature wel werkt in outlook 2010 maar niet in outlook 2003, ik heb echter geen idee waar de fout zit.
Ik hoop dat iemand ziet wat ik fout doe, want ik zie het niet!
Ik wil een script maken om op basis van gegevens uit de active directory een handtekening te maken, hiervoor heb ik onderstaande gemaakt op basis van http://community.spicewor...ectory-information?page=1
Probleem is nu echter dat de signature wel werkt in outlook 2010 maar niet in outlook 2003, ik heb echter geen idee waar de fout zit.
Ik hoop dat iemand ziet wat ik fout doe, want ik zie het niet!
code: filename
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
| On Error Resume Next
Set objSysInfo = CreateObject("ADSystemInfo")
Set WshShell = CreateObject("WScript.Shell")
strUser = objSysInfo.UserName
Set objUser = GetObject("LDAP://" & strUser)
strName = objUser.FullName
strTitle = objUser.Title
strCred = objUser.info
strStreet = objUser.StreetAddress
strLocation = objUser.l
strPostCode = objUser.PostalCode
strPhone = objUser.TelephoneNumber
strMobile = objUser.Mobile
strFax = objUser.FacsimileTelephoneNumber
strEmail = objUser.mail
strCompany = objUser.Company
Set objWord = CreateObject("Word.Application")
Set objDoc = objWord.Documents.Add()
Set objSelection = objWord.Selection
Set objEmailOptions = objWord.EmailOptions
Set objSignatureObject = objEmailOptions.EmailSignature
Set objSignatureEntries = objSignatureObject.EmailSignatureEntries
objSelection.Font.Name = "Arial"
objSelection.Font.Size = "10"
objSelection.Font.Color = RGB(0,0,0)
if (strCred) Then objSelection.TypeText strName & ", " & strCred Else objSelection.TypeText strName
objSelection.TypeText " | "
objSelection.TypeText strTitle
objSelection.TypeText " "
objSelection.TypeText strCompany
objSelection.TypeText Chr(11)
objSelection.Font.Size = "7,5"
objSelection.Font.Color = RGB(128,128,128)
if (strPhone) Then objSelection.TypeText "Tel: " & strPhone
if (strMobile) And (strPhone) Then objSelection.TypeText " | "
if (strMobile) Then objSelection.TypeText "Mob: " & strMobile
objSelection.TypeText Chr(11)
objSelection.TypeText strStreet
objSelection.TypeText ", "
objSelection.TypeText strPostCode
objSelection.TypeText ", "
objSelection.TypeText strLocation
objSelection.TypeText Chr(11)
Set objLink = objSelection.Hyperlinks.Add(objSelection.Range, "mailto: " & strEmail, , , strEmail)
objLink.Range.Font.Name = "Arial"
objLink.Range.Font.Size = "7,5"
objLink.Range.Font.Bold = false
Set objSelection = objDoc.Range()
objSignatureEntries.Add "Full Signature", objSelection
objSignatureObject.NewMessageSignature = "Full Signature"
objDoc.Saved = True
objWord.Quit
Set objWord = CreateObject("Word.Application")
Set objDoc = objWord.Documents.Add()
Set objSelection = objWord.Selection
Set objEmailOptions = objWord.EmailOptions
Set objSignatureObject = objEmailOptions.EmailSignature
Set objSignatureEntries = objSignatureObject.EmailSignatureEntries
objSelection.Font.Name = "Arial"
objSelection.Font.Size = "10"
objSelection.Font.Color = RGB(0,0,0)
if (strCred) Then objSelection.TypeText strName & ", " & strCred Else objSelection.TypeText strName
objSelection.TypeText " | "
objSelection.TypeText strTitle
objSelection.TypeText " "
objSelection.TypeText strCompany
objSelection.TypeText Chr(11)
objSelection.Font.Size = "7,5"
objSelection.Font.Color = RGB(128,128,128)
if (strPhone) Then objSelection.TypeText "Tel: " & strPhone
if (strMobile) And (strPhone) Then objSelection.TypeText " | "
if (strMobile) Then objSelection.TypeText "Mob: " & strMobile
objSelection.TypeText Chr(11)
objSelection.TypeText strStreet
objSelection.TypeText ", "
objSelection.TypeText strPostCode
objSelection.TypeText ", "
objSelection.TypeText strLocation
objSelection.TypeText Chr(11)
Set objLink = objSelection.Hyperlinks.Add(objSelection.Range, "mailto: " & strEmail, , , strEmail)
Set objSelection = objDoc.Range()
objSignatureEntries.Add "Reply Signature", objSelection
objSignatureObject.ReplyMessageSignature = "Reply Signature"
objDoc.Saved = True
objWord.Quit
WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Common\MailSettings\NewSignature" , "Full Signature"
WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Common\MailSettings\ReplySignature" , "Reply Signature"
WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Common\MailSettings\NewSignature" , "Full Signature"
WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Common\MailSettings\ReplySignature" , "Reply Signature"
WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Common\MailSettings\NewSignature" , "Full Signature"
WshShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Common\MailSettings\ReplySignature" , "Reply Signature" |