PDA

View Full Version : VBA code help needed



jrajpal84
12-11-2015, 06:36 AM
Can anyone please help me how I can attach the files to outlook from userprofile directory.

I have to place the workbook into several machines and when a user click the send button , file is sent, please advise how can i make this work ?

Like i have a file in C:\users\XXXX\

if i use .Attachments.Add "%userprofile\filename" i get an error message the file is not found, please check the path of the file.

Please help/

Paul_Hossler
12-11-2015, 07:20 AM
Try this




.Attachments.Add Environ("UserProfile") & "\filename.txt"





If there's spaces in the profile or filename, you'll need to do a little more