View Single Post
 
Old 08-09-2021, 10:42 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

jec1
Looking at the code, it appears to cover what the user asked for and should work quite well. I'm not sure why you might be seeing a problem with Office 365 - the code 'should' work equally well on that version unless it is erroring on the third line here.
Code:
Set docNew = Documents.Add(ActiveDocument.FullName)  'new doc duplicate of 'saved' current doc
docNew.Range.Delete  'deletes initial content from new doc
docNew.Range.FormattedText = rngSel.FormattedText  'Selected range copied to new doc
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote