-
VBA Code help
Hi
I have a Macro where If i click a Link in access it should run the macro and attach a .txt file to the email. But I am getting the .txt file as .xls which I am unable to open. I can see the data is if i right click and open in word. How can I make it the code to attach .txt instead of .xls. Please advice ASAP.
-
Welcome to the forum.
We can't help you without seeing the code. Be sure you wrap the code with VBA tags (click teh green VBA button). This will make the code readable and format it.
-
Here is the code
Function mcrEmailPaymentsXL()
On Error GoTo mcrEmail_Err
Dim txtObjectName As String
Dim txtTO As String
Dim txtSubject As String
Dim txtMessage As String
txtObjectName = "Payments"
txtTO = "xyz@abc.com "
txtSubject = "Payments for " & Date
txtMessage = "Attached are today's payments."
DoCmd.SendObject acSendReport, txtObjectName, acFormatXL, txtTO, "xyz@abc.com", "", txtSubject, txtMessage, False, ""
mcrEmail_Exit:
Exit Function
-
You have used the output format acFormatXL, you should have used
acFormatRTF or
acFormatTXT
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules