Oude leerling
Gebruiker
- Lid geworden
- 30 aug 2010
- Berichten
- 554
snb ,
Hoe deze code in te passen in de bestaande CDO-code
jaap
Hoe deze code in te passen in de bestaande CDO-code
jaap
Bekijk de onderstaande video om te zien hoe je onze site als een web app op je startscherm installeert.
Opmerking: Deze functie is mogelijk niet beschikbaar in sommige browsers.
[SIZE=1]Sub Macro1()
Dim Naam As String
Naam = Range("B6").Value & " " & Range("D16").Value
ChDir "C:\Users\Gebruiker\Documents\Facturen 2017"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Naam & ".pdf"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
With New CDO.Message
.Configuration(cdoSendUsingMethod) = 2
.Configuration(cdoSMTPServer) = "smtp.gmail.com"
.Configuration(cdoSMTPServerPort) = 465
.Configuration(cdoSMTPusessl) = True
.Configuration(cdoSMTPconnectiontimeout) = 60
.Configuration(cdoSMTPauthenticate) = 1
.Configuration(cdosendusername) = "username"
.Configuration(cdosendpassword) = "password"
.Configuration.Fields.Update
'.addattachment ThisWorkbook.Path & "\Filename:=Naam & ".pdf"
.To = "Tol"
.CC = " "
.BCC = " "
.From = "From"
.Subject = "Factuur"
Range("B2:M13").Copy
With GetObject("New:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
.GetFromClipboard
Textbody = Replace(Replace(.GetText, vbTab, " "), vbCrLf, vbLf)
End With
.Textbody = Textbody
.Send
End With
End Sub
[/SIZE]
We gebruiken essentiële cookies om deze site te laten werken, en optionele cookies om de ervaring te verbeteren.