-
Notifications
You must be signed in to change notification settings - Fork 0
/
Get_Signature_with Pictures
48 lines (30 loc) · 1.26 KB
/
Get_Signature_with Pictures
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
Public Function GetSig() As String
Dim Signature As String
Signature = Environ("appdata") & "\Microsoft\Signatures\"
If Dir(Signature, vbDirectory) <> vbNullString Then Signature = Signature & Dir$(Signature & "*.htm") Else Signature = ""
GetSig = CreateObject("Scripting.FileSystemObject").GetFile(Signature).OpenAsTextStream(1, -2).ReadAll
End Function
Public Function PrepareSigforSending() As String
Dim oFSO As Object
Dim oFolder As Object
Dim oSubFolder As Object
Dim oFile As Object
Dim i As Integer
Dim sPath As String
Dim Result As String
'Call FUnction GetSig
Result = GetSig
sPath = Environ("appdata") & "\Microsoft\Signatures"
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFSO.GetFolder(sPath)
For Each oSubFolder In oFolder.subfolders
For Each oFile In oSubFolder.Files
Result = Replace(Result, GetFolderName(oSubFolder.path) & "/" & oFile.Name, oSubFolder.path & "\" & oFile.Name)
Next oFile
Next oSubFolder
Set oFSO = Nothing
Set oFile = Nothing
Set oFolder = Nothing
Set oSubFolder = Nothing
PrepareSigforSending = Result
End Function