Hirdetés
- Google Pixel 10a – évismétlés
- Itt a Galaxy S26 széria: az Ultra fejlődött, a másik kettő alig
- Samsung Galaxy S25 Ultra - titán keret, acélos teljesítmény
- Xiaomi 17 Ultra - jó az optikája
- MIUI / HyperOS topik
- Redmi Note 13 Pro+ - a fejlődés íve
- Huawei P30 - kell ennél több?
- Xiaomi 15 - kicsi telefon nagy energiával
- Xiaomi 15T Pro - a téma nincs lezárva
- Samsung Galaxy S24 Ultra - ha működik, ne változtass!
-
Mobilarena
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
Ismét kéne egy kis segítség. Van egy PDF-küldős makróm.
Az alábbi pontokkal szembesülök.
1. Az A1 cellában egy hiperhivatkozás van. A PDF-ben ez nem jelenik meg, csak mint szöveg látom.
2. Az Outlook-üzenet első sora nem "Hallo Kollegen" ahogy megadtam, hanem "FalseHallo Kollegen"
2. Az e-mail törzsben az első sor ( "FalseHallo Kollegen") az Times New Roman 12-es betűméret, míg a 2-3. sor 9-es betűméret Calibri.Megadtam milyen legyen a betűtípus a makróban és mégsem olyan. Illetve alapból Arial 10-es a betűtípus az e-mail-írásnál, szóval nem értem miért változtatja random Times New Romanra meg Calibrire.
Köszönöm
A makró:
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 = 1 ' 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 breakHtmlBody = "Hallo Kollegen, <br>" _& "<br>" _& "Im Anhang sehen Sie die aktuelle PIP-Liste von BOS MOS."' Set the font for the html-body (parentheses are just because of MrExcel posting limitation)HtmlFont = HtmlFont = "<body font: " & 11 & "pt " & Arial & ";color:black"">"' Define PDF filenamePdfFile = Range("'help_MOS'!an1")' Replace illegal symbols in PdfFile by underscoreFor Each char In Split("? "" / \ < > * | :")PdfFile = Replace(PdfFile, char, "_")Next' Apply %TEMP% path to the file namePdfFile = 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 specific worksheet 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("'help_MOS'!an1").To = Range("'help_MOS'!an2") ' <-- 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
- KODI (ex-XBMC) Android alapokon, Androidos media-boxok
- Kuponkunyeráló
- Parkside szerszám kibeszélő
- Sorozatok
- Linux Mint
- Nvidia GPU-k jövője - amit tudni vélünk
- Milyen billentyűzetet vegyek?
- SUSE Linux
- Google Pixel 10a – évismétlés
- Itt a Galaxy S26 széria: az Ultra fejlődött, a másik kettő alig
- További aktív témák...
- PC Game Pass előfizetés
- Kaspersky, BitDefender, Avast és egyéb vírusírtó licencek a legolcsóbban, egyenesen a gyártóktól!
- Adobe Előfizetések - Adobe Creative Cloud All Apps - 12 Hónap - 15% AKCIÓ
- Windows, Office licencek kedvező áron, egyenesen a Microsoft-tól - Automata kézbesítés utalással is!
- Számlás!Steam,EA,Epic és egyébb játékok Pc-re vagy XBox!
- BESZÁMÍTÁS! MSI B450 R7 1700 16GB DDR4 512GB SSD GTX 1070 8GB Rampage SHIVA Thermaltake 500W
- AKCIÓ! LENOVO ThinkPad P15 Gen 1 munkaállomás - i7 10750H 16GB DDR4 256GB SSD Quadro T1000 W11
- darkFlash ZR12 Darkstorm
- Gamer PC-Számítógép! Csere-Beszámítás! I7 7700K / GTX 1080 8GB / 16GB DDR4 / 500GB SSD
- Apple iPhone 15 128GB, Kártyafüggetlen, 1 Év Garanciával
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
Fferi50
