View Single Post
 
Old 01-21-2024, 03:53 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,166
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

You haven't provided your full code but it sounds like you have defined both aDoc and newDoc as the same document.

When your code starts up, you should define the activedocument before you start getting confused with a second document eg
Code:
Set aDoc = ActiveDocument
Then you can create and define the new document in a single line
Code:
Set newDoc = Documents.Add
This allows you to be very clear that these are two different documents, both open at the same time.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote