Quantcast
Channel: SharePoint Legacy Versions - Using SharePoint Designer, InfoPath and Other Customizations Forum
Viewing all articles
Browse latest Browse all 2319

Is there a way to rename an Outlook file attachment initiated by Do.Cmd.SendObject acReport ?

$
0
0

Hi

I use code to save a PDF with dynamic names like "Invoice no 345 from Sigtuna Brewery.pdf"

To save them with names like that works fine in my code.

DoCmd.OpenForm "CathFAKTno", acNormal, "", "", , acHidden
' line above opens a Form to cath Invoice No and some more

        DoCmd.OutputTo acOutputReport, "Faktura Invoice", "PDFFormat(*.pdf)", [Forms]![Alla Val]![OwnPathFakt] & [Forms]![CathFAKTno]![TextOnFakturan] & " " & [Forms]![CathFAKTno]![FAKT] &" " & [Forms]![Alla Val]![Firma] & " " & ".pdf", False, "", , acExportQualityPrint
' lines above save the PDF with the wanted name - works just fine

        DoCmd.SendObject acReport, "Faktura Invoice", "PDFFormat(*.pdf)", "", "", "", "", "", True, ""
' line above creates an Outlook email with file attachment name "Faktura Invoice.pdf"
' What I would like to do is to give the file the same name as in second line of code above. 
' So that the name could be dynamic as "Invoice no 345 from Sigtuna Brewery.pdf"
' But I have failed :-(

DoCmd.Close acForm, "CathFAKTno"
' line above close a form

Is there a way?


Best // Peter Forss Stockholm and Sigtuna GMT +1.00



Viewing all articles
Browse latest Browse all 2319

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>