Hirdetés
- GoodSpeed: Ebes, a megtervezett falu!
- Luck Dragon: Asszociációs játék. :)
- petipetya: Nagy chili topic. :)
- Brogyi: CTEK akkumulátor töltő és másolatai
- D1Rect: Nagy "hülyétkapokazapróktól" topik
- GoodSpeed: Alza+ Megéri?
- Trewerr: Analóg-digitális jelátalakítás (zenefájlok leegyszerűsítésével magyarázva)
- Sub-ZeRo: Euro Truck Simulator 2 & American Truck Simulator 1 (esetleg 2 majd, ha lesz) :)
- sziku69: Fűzzük össze a szavakat :)
- Meggyi001: Kórházi ellátás: kuka vagy finom?
-
LOGOUT
A Microsoft Excel topic célja segítséget kérni és nyújtani Excellel kapcsolatos problémákra.
Kérdés felvetése előtt olvasd el, ha még nem tetted.
Új hozzászólás Aktív témák
-
spe88
senior tag
válasz
Pakliman
#46446
üzenetére
az enyém ilyen, de nem értem ott mi a baj. Igaz nem is értek hozzá túlzottan

Sub SendPDF_WithAccountSignatiure()' --> User settings, change to suitConst IsDisplay As Boolean = True ' Change to False for .Send instead of .DisplayConst IsSilent As Boolean = False ' Change to True to show Send statusConst FontName = "Arial" ' Font name of the email bodyConst FontSize = 11 ' Font size of the email bodyConst Account = 2 ' Index or Name of the account to send from' <-- End of the settingsDim IsCreated As BooleanDim OutlApp As ObjectDim char As VariantDim PdfFile As String, HtmlFont As String, HtmlBody As String, HtmlSignature As String' Edit the body's html text as required' The tags are: h3 is for Header#3; b is for Bold; br is for line break' HTML tag's are not displayed properly in the post of MrExcel forum, thus replacing is used to fix this problemHtmlBody = "Hello, (br)" _& ".(br)" _& "Proba."HtmlBody = Replace(HtmlBody, "(", "<")HtmlBody = Replace(HtmlBody, ")", ">")' Set the font for the html-body (parentheses are just because of MrExcel posting limitation)HtmlFont = HtmlFont = "(body font: " & 11 & "pt " & Arial & ";color:black"")"HtmlFont = Replace(HtmlFont, "(", "<")HtmlFont = Replace(HtmlFont, ")", ">")' Define PDF filenamePdfFile = Range("'Report MOS'!L1")' Replace illegal symbols in PdfFile by underscoreFor Each char In Split("? "" / \ < > * | :")PdfFile = Replace(PdfFile, char, "_")Next' Apply %TEMP% path to the file name and limit lenght of the pathnamePdfFile = Environ("F:\03_PROJEKTE\02_BOS\2.4 SERIENBETREUUNG") & PdfFile & ".pdf"' Try to delete PDF file if presentIf Len(Dir(PdfFile)) Then Kill PdfFile' Export the activesheet as PDFWith Worksheets("Report MOS").ExportAsFixedFormat Type:=xlTypePDF, Filename:=PdfFile, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=FalseEnd With' Use the already open Outlook if possibleOn Error Resume NextSet OutlApp = GetObject(, "Outlook.Application")If Err ThenSet OutlApp = CreateObject("Outlook.Application")IsCreated = TrueEnd IfOutlApp.Visible = TrueOn Error GoTo 0' Prepare email with PDF attachment and the default signatureWith OutlApp.CreateItem(0)' Set HTML format.BodyFormat = 2' Add the attachment first for correct attachment's name with non English symbols.Attachments.Add PdfFile' Set the required account by const AccountSet .SendUsingAccount = OutlApp.Session.Accounts.Item(Account)' Get default email signature without blinking (instead of .Display method)With .GetInspector: End WithHtmlSignature = .HtmlBody' Prepare e-mail.Subject = Range("'Report MOS'!L1").To = Range("'Report MOS'!L2") ' <-- Put email of the recipient here.HtmlBody = HtmlFont & HtmlBody & HtmlSignature' Try to send or just display the e-mailOn Error Resume NextIf IsDisplay Then .Display Else .Send' Show error of the .Send methodIf Not IsDisplay Then' Return focus to Excel's windowApplication.Visible = True' Show error/success messageIf Err ThenMsgBox "E-mail was not sent for some reasons" & vbLf & "Please check it", vbExclamation.DisplayElseIf Not IsSilent ThenMsgBox "E-mail successfully sent", vbInformationEnd IfEnd IfEnd IfOn Error GoTo 0End With' Try to quit Outlook if it was not previously openIf IsCreated Then OutlApp.Quit' Try to release the memory of object variableSet OutlApp = NothingEnd Sub
Új hozzászólás Aktív témák
- Fizetős szoftverek ingyen vagy kedvezményesen
- Milyen légkondit a lakásba?
- Mibe tegyem a megtakarításaimat?
- Annyira azért nem egyedi tervezésűek a Steam Machine fő komponensei
- Konzolokról KULTURÁLT módon
- GoodSpeed: Ebes, a megtervezett falu!
- Nyíregyháza és környéke adok-veszek-beszélgetek
- Villanyszerelés
- Milyen okostelefont vegyek?
- Hardcore café
- További aktív témák...
- Lenovo IdeaPad Slim 3 - 15.6" Full HD - Ryzen 5-7520U - 8GB - 512GB - Win11 PRO - MAGYAR - Garancia
- BESZÁMÍTÁS! GIGABYTE B760M i5 14600KF 32GB DDR4 1TB SSD RTX 3080 10GB ZALMAN Z1 Plus A-Data 750W
- ÁRGARANCIA!Épített KomPhone i5 10400F 16/32/64GB RAM RX 7600 8GB GAMER PC termékbeszámítással
- LG Gram 14 WUXGA IPS i7-1360P 5.0Ghz 12mag 32GB DDR5 1TB SSD Intel Iris XE 10óra Akku Win11 Garancia
- Apple iPhone 16 Pro Max 256GB, Kártyafüggetlen, 1 Év Garanciával
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
Cég: NetGo.hu Kft.
Város: Gödöllő

Fferi50
