473,322 Members | 1,287 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

E-mail Attachment

Hello everyone, using A2003

I would like to send via email a txt file located on the c:\ drive
which I create by using a transfer text procedure.

My problem is that the file name is variable, such as RefMMDDHHmm where
REF is a fixed value, so..... the question?

How can I adapt this code that I normally use to send email with
attachments, to send the txt file when I only know the first 3
characters e.g 888

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

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

With objEmail
.To = "email address"
.Subject = "subject"
.Body = "Notes"
.Attachments.Add "ATTACHMENT"
.Send
End With

Set objOutlook = Nothing

P.S. I was looking into BLAT e-mailing but could it get it to work, can
some point me to the a website with a full explanation on how to use
such email system? I would appreciate it. (I already got the BLAT.exe
and the VB class, but every time I run it I get an error. do I need to
reference something???

Thanx

Nov 13 '05 #1
2 2087
GAVO-UK wrote:
P.S. I was looking into BLAT e-mailing but could it get it to work, can
some point me to the a website with a full explanation on how to use
such email system? I would appreciate it. (I already got the BLAT.exe
and the VB class, but every time I run it I get an error. do I need to
reference something???


Blat references the smtp address and a user address in a registry
setting. I used to use Blat in a win 98 environment, but my A97 app
with it failed when the user converted to winXP. Since the command line
I shell out for blat mailing is something that references text file
locations and with the XP user documents line so darn long and the
limitation (in the win98 command prompt, anyway) of a certain number of
characters permitted, I gave up trying to use blat. mind you, I don't
know what versions are available now - I was using the latest Blat about
3 or 4 years ago.

I switched back to using sendobject which has it's own problems in
A2003, not least being the inability of Netscape 7.x to recreate the
"to" addresses, ie, emails are constructed without any addressees. I've
had to address this by having the edit argument set to true and whenever
my app with email generates an email, a form appears with the to
address(es) showing (and a button to bypass this form, if the user's
email configuration works). The send button on that form invokes the
sendobject command and uses an API procedure to copy the adress(es) to
the clip board so that when a user sees there's no to address on their
email, they can paste it.

Klunky as hell, but, as I mentioned, unless you're using Outlook,
sendobject has at least one problem.

--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #2
Use the DIR function to find all files starting with 888 then attach them
like your "known" file names.

"GAVO-UK" <an****@peopleex.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
Hello everyone, using A2003

I would like to send via email a txt file located on the c:\ drive
which I create by using a transfer text procedure.

My problem is that the file name is variable, such as RefMMDDHHmm where
REF is a fixed value, so..... the question?

How can I adapt this code that I normally use to send email with
attachments, to send the txt file when I only know the first 3
characters e.g 888

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

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

With objEmail
.To = "email address"
.Subject = "subject"
.Body = "Notes"
.Attachments.Add "ATTACHMENT"
.Send
End With

Set objOutlook = Nothing

P.S. I was looking into BLAT e-mailing but could it get it to work, can
some point me to the a website with a full explanation on how to use
such email system? I would appreciate it. (I already got the BLAT.exe
and the VB class, but every time I run it I get an error. do I need to
reference something???

Thanx

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Wald | last post by:
Hello group, I've got a script here that sends emails with an attachment to an email address that is retrieved from an html form. The email sending code is include below. The problem: when...
3
by: Paul Lamonby | last post by:
Hi, I am sending a file from the server as an email attachment. The file is being attached no problem and sending the email, but I get an error when I try to open it saying it is corrupt....
1
by: abracad | last post by:
I'd like to add a form that will email a file attachment to me. Can anyone recommend a decent free script? Thanks
2
by: New User | last post by:
Hi, I have a PDF file that I am trying to send as an attachment through a C# program. Even though the PDF file can be opened by itself, sometimes the same file cannot be opened as an...
7
by: Susan Bricker | last post by:
I would like to generate a report (I have the report working already) using MS/ACCESS 2000 and then have the ability to send the report as an email attachment to my colleagues. I have looked...
6
by: brendan_gallagher_2001 | last post by:
Hi, Does anyone know how to create an attachment using a stream in classic ASP. I can see that it can be done in ASP.Net as per the article below: Initializes a new instance of the Attachment...
7
by: erikcw | last post by:
Hi all, I'm trying to extract zip file (containing an xml file) from an email so I can process it. But I'm running up against some brick walls. I've been googling and reading all afternoon, and...
6
by: jordanbondo | last post by:
I need to be able to connect to MS Exchange 2007 and find a particular email with a particular attachment on it. This attachment is sent to multiple people, but I have an account set up where the...
1
by: =?Utf-8?B?QnJhc3NpY2FOaWdyYQ==?= | last post by:
Greetings, This question does not seem to fit any of the forum headers so I picked the most general sounding forum I could find. My laptop is running Vista Ultimate. I use yahoo.com for...
0
by: peterschedler | last post by:
How do I send an MS Word (2002) document file ( 140 MB )as a .txt email attachment and how can the recipient open it ? I am using ORANGE webmail and Mozilla Firefox .
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.