By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,510 Members | 1,497 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,510 IT Pros & Developers. It's quick & easy.

E-mail Attachment

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.