View Single Post
 
Old 12-13-2016, 09:41 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,137
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

If there are more than one period characters, using split creates a few more problems. It would be better to use

Code:
    sFile = ActiveDocument.Name
    sFile = Left(sFile, InStrRev(sFile, Chr(46))) & "docx"
    'or, if you want to add some text to the end of the filename
    'sFile = Left(sFile, InStrRev(sFile, Chr(46)) - 1) & "-sometext.docx"
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote