esdee303 Posted January 10, 2011 Share Posted January 10, 2011 Hello,I want to accomplish followingI have a filename: 10BE10100026391803-2-1.emf (which is an attachment in outlook)What i want do to do is:- replace "-" with "_"- switch position of charachter "2" and "1"i can replace "-" with "_" : FileNameChanged = Replace(objAttachments.Item(dblLoop).FileName, "-", "_")What i can't find out is how to switch the position of those two characters.The position of the "1" is always 5th from the right and the position of "2" is always 7th. value can change, so i have to use the position of the character.Anyone knows how i can switch these characters ?ThxSteven Link to comment Share on other sites More sharing options...
jeffman Posted January 10, 2011 Share Posted January 10, 2011 The replace method should give you start and count arguments that might make life easier.More sophisticated replacements might be done using the RegularExpressionObject and its replace method. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.