Ik heb een goed werkende excel VBA macro om een werkblad van excel in Outlook te krijgen. Ik wil deze nu ook automatisch met een van mijn handtekeningen mét picture laten ondertekenen.
Ik heb via de site van Ron de Bruin 2 afzonderlijke macros gevonden maar niet een gecombineerde. Mijn pogingen om dit zelf in elkaar te vlechten zijn niet gelukt.
Kan iemand specifiek aangeven waar ik in de code aanpassingen moet doen om mijn handtekening (Verloning) via de macro te kunnen plaatsen?
Hieronder de hele macro zoals van de site van Ron de Bruin en ik al enige jaren gebruik:
_____________________________________________________________________
______________________________________________________
Ik ben benieuwd of iemand mij kan helpen.
Alvast bedankt,
Pinkels.
Ik heb via de site van Ron de Bruin 2 afzonderlijke macros gevonden maar niet een gecombineerde. Mijn pogingen om dit zelf in elkaar te vlechten zijn niet gelukt.
Kan iemand specifiek aangeven waar ik in de code aanpassingen moet doen om mijn handtekening (Verloning) via de macro te kunnen plaatsen?
Hieronder de hele macro zoals van de site van Ron de Bruin en ik al enige jaren gebruik:
_____________________________________________________________________
Visual Basic:
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
| Dim FileExtStr As String Dim FileFormatNum As Long Dim Sourcewb As Workbook Dim Destwb As Workbook Dim TempFilePath As String Dim TempFileName As String Dim OutApp As Object Dim OutMail As Object With Application .ScreenUpdating = False .EnableEvents = False End With Set Sourcewb = ActiveWorkbook 'Copy the sheet to a new workbook ActiveSheet.Copy Set Destwb = ActiveWorkbook 'Determine the Excel version and file extension/format With Destwb If Val(Application.Version) < 12 Then 'You use Excel 2000-2003 FileExtStr = ".xls": FileFormatNum = -4143 Else 'You use Excel 2007-2010, we exit the sub when your answer is 'NO in the security dialog that you only see when you copy 'an sheet from a xlsm file with macro's disabled. If Sourcewb.Name = .Name Then With Application .ScreenUpdating = True .EnableEvents = True End With MsgBox "Your answer is NO in the security dialog" Exit Sub Else Select Case Sourcewb.FileFormat Case 51: FileExtStr = ".xlsx": FileFormatNum = 51 Case 52: If .HasVBProject Then FileExtStr = ".xlsm": FileFormatNum = 52 Else FileExtStr = ".xlsx": FileFormatNum = 51 End If Case 56: FileExtStr = ".xls": FileFormatNum = 56 Case Else: FileExtStr = ".xlsb": FileFormatNum = 50 End Select End If End If End With ' 'Change all cells in the worksheet to values if you want ' With Destwb.Sheets(1).UsedRange ' .Cells.Copy ' .Cells.PasteSpecial xlPasteValues ' .Cells(1).Select ' End With ' Application.CutCopyMode = False 'Save the new workbook/Mail it/Delete it TempFilePath = Environ$("temp") & "\" TempFileName = "Factuur bedrijf" & [D2] & " week " _ & [C2] & Format(Now, " ") Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(0) With Destwb .SaveAs TempFilePath & TempFileName & FileExtStr, _ FileFormat:=FileFormatNum On Error Resume Next With OutMail .From = "mail@bedrijf.nl" .To = [T5] & [T3] & [T2] & [T4] .CC = "" .BCC = "" .Subject = "Factuur bedrijf" & [D2] & " voor " & [D4] & " week " & [C2] .Body = "Goedendag," & vbNewLine & vbNewLine & _ "hierbij de gewerkte uren van week " & [C2] _ & vbNewLine & vbNewLine & "Met vriendelijke groet," _ & vbNewLine & vbNewLine & "bedrijf Urenadministratie" _ & vbNewLine & Application.UserName .Attachments.Add Destwb.FullName 'You can add other files also like this '.Attachments.Add ("C:\test.txt") .Display 'or use .Display End With On Error GoTo 0 .Close SaveChanges:=False End With 'Delete the file you have send Kill TempFilePath & TempFileName & FileExtStr Set OutMail = Nothing Set OutApp = Nothing With Application .ScreenUpdating = True .EnableEvents = True End With Sheets("AB EU kopie").Select End Sub |
______________________________________________________
Ik ben benieuwd of iemand mij kan helpen.
Alvast bedankt,
Pinkels.
[ Voor 0% gewijzigd door F_J_K op 30-05-2019 10:15 . Reden: bedrijfsnaam etc weg ]