Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 01-21-2024, 03:53 PM
Guessed's Avatar
Guessed Guessed is offline Working with an active document and new document to retain styles and cross-referencing Windows 10 Working with an active document and new document to retain styles and cross-referencing 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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Code on a button to attach a document to my Word Auto fill document is not working on a Mac reynoldsrjr Word 0 03-30-2020 04:00 AM
Single step Word Styles from Source Document through entire Destination document? xbliss Word 6 08-27-2016 09:36 PM
How to save active document to SharePoint document library Rose roon Word VBA 9 09-22-2015 10:53 PM
document styles and some formatting doesn't appear where should when different people view document Dilbert fan Word 1 08-23-2015 05:07 AM
Working with an active document and new document to retain styles and cross-referencing Cross Referencing w/Track Changes Active Liza Word 1 11-06-2014 12:44 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:35 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft