cathgill
08-26-2005, 01:12 AM
Hi. I want Word to email a text file. I tried RoutingSlip - this only works if the file is open - I could live with that, but when the file arrives at the recipient's inbox, it's renamed to filename.doc rather than filename.txt.
This is the code I used:
ChangeFileOpenDirectory "C:\OmniScribe\Admin\"
Documents.Open FileName:="WorkLog.txt", ConfirmConversions:=False
DocumentToEmail = "WorkLog.txt"
Documents(DocumentToEmail).HasRoutingSlip = True
With Documents(DocumentToEmail).RoutingSlip
.Subject = DocumentToEmail
.AddRecipient Recipient:="frednurk@bigpond.net.au"
.Delivery = wdAllAtOnce
End With
Documents(DocumentToEmail).Route
You can see that the code doesn't save the text file once it's opened it, so I don't see why Word would convert it during the emailing process.
Ideally, does anyone know code to email the text file without opening it? Alternatively, is there any way to stop Word from renaming the file in the process?
I have Outlook Express - the only thing I can guarantee about the users of the code is that they'll have Word 2000 + and some sort of email.
I looked at a thread called "Mail From Word Using standard MailClient" and was getting quite excited until I saw "ActiveDocument" at the end of the code.
Thank you, thank you in advance - Cath
This is the code I used:
ChangeFileOpenDirectory "C:\OmniScribe\Admin\"
Documents.Open FileName:="WorkLog.txt", ConfirmConversions:=False
DocumentToEmail = "WorkLog.txt"
Documents(DocumentToEmail).HasRoutingSlip = True
With Documents(DocumentToEmail).RoutingSlip
.Subject = DocumentToEmail
.AddRecipient Recipient:="frednurk@bigpond.net.au"
.Delivery = wdAllAtOnce
End With
Documents(DocumentToEmail).Route
You can see that the code doesn't save the text file once it's opened it, so I don't see why Word would convert it during the emailing process.
Ideally, does anyone know code to email the text file without opening it? Alternatively, is there any way to stop Word from renaming the file in the process?
I have Outlook Express - the only thing I can guarantee about the users of the code is that they'll have Word 2000 + and some sort of email.
I looked at a thread called "Mail From Word Using standard MailClient" and was getting quite excited until I saw "ActiveDocument" at the end of the code.
Thank you, thank you in advance - Cath