kanwal said:
thanks alot , i am using now Name....but it shows extension also? anyway
to
get rid of it (other then instr/left)
I would recommend that if you are going to need to strip the extension
frequently, then write a small function that does just that, rather than
using the string manipulation functions every time. I have a variety of such
functions in a library, for stripping the extension, for returning only the
extension, for getting the path, for removing the path part etc. All tested
and I know they work, so much less opportunity for errors to creep in. I
would recommend you do the same.
By the way, Perry didn't answer the other part of your question - how to
write the contents of a variable into the current document. This depends on
*where* in the document you want it written, but if you want it inserted at
the current selection point, then it is as simple as
Selection.Typetext myString
where myString is a string variable containing the text you want to insert.
--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition
www.classicvb.org