Trimming File Extension from File Name

R

Rob

Hi,

I'm trying to trim the extension from a file name. I have been able to get
the extension now I just need to get only the name. Here's what I have.

Dim Item As Object
Dim Atmt As Attachment
Dim fExt As String
Dim fName As String

For Each Atmt In Item.Attachments
fExt = Right(Atmt.FileName, 4) 'returns the .??? extension
fName =


Thanks Much.
Rob
 
M

Michael Bauer [MVP - Outlook]

Yu cannot be sure that the extension has a length of four characters, or?
It's better to search backwards for the dot, use the InstrRev function for
that. Once, you know where the dot is, everyting right of it is the
extension and left of it the file name.

For more programming related questions visit
microsoft.public.outlook.program_vba, please.

--
Best regards
Michael Bauer - MVP Outlook
Use Outlook Categories? This is Your Tool:
<http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6>

Am Mon, 17 Mar 2008 07:18:04 -0700 schrieb Rob:
 
R

Rob

Why can't I ever get a straight answer when it comes to Outlook? I'm not that
darn savvy on this kind of stuff, at best I fumble around and come up with
the right answer after tons of help.

Since I've obviously triggered something by posting here, I'll repost it
where you suggested. But can I actually get the answer I'm looking for there?
 
J

John Blessing

Rob said:
Why can't I ever get a straight answer when it comes to Outlook? I'm
not that darn savvy on this kind of stuff, at best I fumble around
and come up with the right answer after tons of help.

Since I've obviously triggered something by posting here, I'll repost
it where you suggested. But can I actually get the answer I'm looking
for there?

Calm down, calm down. No one here gets paid for answering your questions. A
little civility goes a lonnnnnnnnnnnnnnnnnnnnnggggg way.
--
John Blessing

http://www.LbeHelpdesk.com - Help Desk software
http://www.room-booking-software.com - Schedule rooms & equipment
bookings http://www.lbetoolbox.com - De-Duplicates MS Outlook
http://www.repeatmail.com - schedule mass individual emails
 

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

Top