outlook mail & MS Access

  • Thread starter Thread starter yipppeee
  • Start date Start date
Y

yipppeee

Hi everyone!

I'm trying to automate a process that sends a fixed-width, text file (a
query). If I use "sendobject", it formats it as a delimited text file which
is unacceptable. Currently it is set up as a two-step process - (1) export
to desktop using an export spec, and (2) email the text file. However this
is a manual process. I need this to run at midnightIsn't there a way using
Access or VBA to send a fixed-width text file?

While I'm asking, is there a way to get around the warning message that
Access asks when using "sendobject "? Can a "YES" answer be automated?
This process needs to be run each Monday evening & I really don't want to
have to stay late every Monday.

TIA

(e-mail address removed)
 
Create a macro
Use the TransferText Action
This allows you to create a specification for you file
format.

Use the code below from Arvin Meyer to send the attachment.
Private Sub Command0_Click()
'Arvin Meyer 03/12/1999
'Updated 7/21/2001
On Error GoTo Error_Handler

Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem

Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)

With objEmail
.To = "(e-mail address removed)"
.Subject = "Look at this sample attachment"
.body = "The body doesn't matter, just the attachment"
.Attachments.Add "C:\Test.htm"
'.attachments.Add "c:\Path\to\the\next\file.txt"
.Send
'.ReadReceiptRequested
End With

The security dialogs that pop up when an application tries
to access Outlook designed to inhibit the spread of
viruses. Try this freeware to auto click the Yes
(http://www.express-soft.com/mailmate/clickyes.html)

Jim
 
Thanks Jim!

I had the "transfertext" action, but I needed the coding for the outlook
portion. I'll try it & see, but I can't see why it won't work. I had
already downloaded the "clickyes" program - works great.

Thanks again!

Craig
 
Back
Top