![]() |
|
|
|
#1
|
||||
|
||||
|
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 |
|
| Tags |
| active document, styles |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
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 |
Using With ActiveDocument.Tables()
|
SuzeG | Word VBA | 1 | 01-08-2014 02:00 PM |