Need the period in front of Attachments.
.Attachments.Add
Now I see your original code is missing that.
Need the period in front of Attachments.
.Attachments.Add
Now I see your original code is missing that.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Still the same issue I am running Office 2013, would that make a difference? Do I need to check something in the VBA Tools Refrence Library?
I took out the error reporting and this line is the issue:
Even though I haveCode:strSubject = "By Field Report - " & ![Field Name] & " - " & Format(Now, "dd mmm yyyy")
Dim strSubject as String
Yes, need the Outlook Object Library.
I would expect different error messages if the library is not selected.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
I have the MS Outlook library selected.
I fixed the string issue by putting a ' after the second "
strSubject = "By Field Report - " ' & ![Field Name] & " - " & Format(Now, "dd mmm yyyy")
This is not what I want though. I would like all of it Report Name - Section - Date. It works with the SendObject.
Once this was "fixed" I got an error on the .Send
I would like to hit send myself, and have the window pop open. No Email windows opened.
That apostrophe makes no sense. It should error.
Instead of .Send, .Display
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
The .Display worked. I just took out all the extra with the " to make it look like a comment. Then it ran. The .Display worked well, but the subject remained blank, the signature block was correct. The file was not deleted after the send though.
Okay, I get what the apostrophe was doing.
The variables should work.
The .Delete works for me with the .Send.
The .Subject and .Body lines are commented in your code. Don't see a .To line.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Probably the delete doesn't work since I manual send. Thats OK by me as I have found out the add attachement will pick up the specific file needed regardless of other files in that folder.
I didn't add a .To line as I will use outlooks address book. I have to manualy select the adressee's since it is always changing.
I figured out the blank subject issue by changing the strSubject to .Subject and changing ![Field Name] to Me.[Field Name]
Mucho Gracias