Hi all,
I'm trying to attach a invoice (pdf) to an email with vba and I want the code to grab the invoice regardless what else might be in the document name, such as "Invoice 1" or "Invoice approved", etc.. The invoice is always a pdf file.
This code works. It grabs the invoice as long as it is just called "Invoice":
.Attachments.Add "\\NetworkLocation\data\Admin\Environmental" & "\Invoice.pdf
This code doesn't work because it doesn't find "Invoice 1":
.Attachments.Add "\\NetworkLocation\data\Admin\Environmental" & "\" Like "Invoice*"
Any help is appreciated.
Brando
I'm trying to attach a invoice (pdf) to an email with vba and I want the code to grab the invoice regardless what else might be in the document name, such as "Invoice 1" or "Invoice approved", etc.. The invoice is always a pdf file.
This code works. It grabs the invoice as long as it is just called "Invoice":
.Attachments.Add "\\NetworkLocation\data\Admin\Environmental" & "\Invoice.pdf
This code doesn't work because it doesn't find "Invoice 1":
.Attachments.Add "\\NetworkLocation\data\Admin\Environmental" & "\" Like "Invoice*"
Any help is appreciated.
Brando