View Single Post
 
Old 01-04-2012, 03:22 PM
Marrick13 Marrick13 is offline Windows XP Office 2010 32bit
Competent Performer
 
Join Date: Jun 2006
Posts: 102
Marrick13 will become famous soon enough
Default Loop through listboxes in Application.OrganizerCopy

Macropod,

Thanks much for the demo file. I can see that the msgbox does scroll though the styles and files, going thru the styles for the first file and again for the next file (I commented out the Call Box2Populate module because I want to copy only the styles chosen by a user).

That is what I need for the organizercopy code snippet to do to actually copy the styles to the selected files. However, when I shut off the msgbox and activate the organizercopy snippet, I get the same error as before.

I've attached the application itself ("Style Copier Application"), with your demo code added so you can see the whole picture (run the "SelectandApplyStyles" macro to start it). I've commented out the msgbox in Sub CmdCopyStyle_Click and activated the Application.OrganizerCopy snippet.

I've also attached test files I set up to confirm the styles were actually copied, although I haven't needed them because I can't get the copy to work yet: "Template for Headings 1-2" is the "copy from" file that contains headings 1 and 2 modified to a different font and size from the normal template, and "Test1" and "Test2" are the target files which have a smaller font heading 1. You don't need these but they're here if you want to use them.

I appreciate your help!
Attached Files
File Type: doc Style Copier Application (Jan 4 2012).doc (95.0 KB, 29 views)
File Type: doc Template for Headings 1-2.doc (44.0 KB, 29 views)
File Type: doc test1.doc (27.0 KB, 26 views)
File Type: doc test2.doc (26.0 KB, 26 views)
Reply With Quote