email attachements in vb .net

  • Thread starter Thread starter Bernie Yaeger
  • Start date Start date
B

Bernie Yaeger

I know how to attach a document to an email inside vb .net with
msg.attachments.add("c:\ppp.txt")

However, is there a way to attach files via wildcards - eg, c:\p*.txt to get
c:\ppp.txt and c:\ppw.txt? I tried it directly but got an unrecognized cast
error.

Thanks for any help.

Bernie Yaeger
 
figured out a way - just looping with dirinfo and attaching only those that
meet the spec.

Tx

Bernie
 
* "Bernie Yaeger said:
I know how to attach a document to an email inside vb .net with
msg.attachments.add("c:\ppp.txt")

However, is there a way to attach files via wildcards - eg, c:\p*.txt to get
c:\ppp.txt and c:\ppw.txt? I tried it directly but got an unrecognized cast
error.

\\\
For Each s As String In Directory.GetFiles("C:\p*.txt")
...
Next s
///
 
Tx Herfried - as usual, your solution was more elegant than mine!

Bernie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top