Hello,
I am writing VBA coded to execute a macro that attaches a file to an email. Within the code, I use the .Attachments.Add command along with the directory path of where the attachment resides. All works fine and the macro does its job by attaching the chosen file to the email as expected, except when one of the subdirectories is named with two words separated by a space.
For example, when the directory path is c:\users\tom\documents\test.pdf, the macro attaches the file successfully to the email. However, when the directory path is c:\users\tom\test files\test.pdf and the subdirectory "test files" name contains a space between the two words, the macro is unable, or won't, attach the file to the email.
Please comment if you know of a reason why the macro does not perform as expected. Does there need to be a character to be placed between the two words when I type the .Attachments.Add command and add the directory path where the file I want to attach is located? I'm stuck.
Bookmarks