Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-25-2018, 12:36 AM
Guessed's Avatar
Guessed Guessed is offline OrganizerCopy method for ActiveDocument Windows 10 OrganizerCopy method for ActiveDocument Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,185
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

How you open the myFile document is irrelevant UNLESS you have created a new document and the file has not yet been given a name and filepath location. But you do have some other issues with your code that would also be failure points.



OrganizerCopy expects the Source and the Destination to both be of type string. You supplied one string and one document so that would be a likely point of failure.
Secondly, myFile may not be saved yet and therefore its path doesn't yet exist
Thirdly, myFile may not be writeable. You can open a document but it could be opened in Read Only mode. The error message sounds like this is likely to be the problem.
Fourthly, DocSource may not exist or be readable.
Finally, does the style called 'Caption-Photo' exist in the DocSource file? It's not a built-in style name so there is always the danger that it doesn't exist.

If you choose to do this manually, style by style that is your prerogative but it can be done with a single line if you used an attached template - Just saying...
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
Reply

Tags
active document, styles



Similar Threads
Thread Thread Starter Forum Replies Last Post
OrganizerCopy method for ActiveDocument Loop through listboxes in Application.OrganizerCopy Marrick13 Word VBA 50 04-16-2024 01:21 PM
ActiveDocument.ContentControls(ID) not working Tejas.T Word VBA 3 03-09-2015 06:50 PM
Loop through listboxes in Application.OrganizerCopy-revisited Marrick13 Word VBA 0 12-06-2014 06:07 AM
wordapp.ActiveDocument.SaveAs Not Working KSReynolds Mail Merge 1 07-18-2014 04:03 PM
OrganizerCopy method for ActiveDocument Using With ActiveDocument.Tables() SuzeG Word VBA 1 01-08-2014 02:00 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:24 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