View Single Post
 
Old 01-11-2012, 04:17 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 so much for your assistance! It's been a huge help. Now it looks good - I added a third style filter option - one that loads all the styles - to the other two. I have tested the error trap this way and it works fine from what I've seen so far.

As for why the code errors on some styles, according to http://windowssecrets.com/forums/sho...A-Word-2003%29, the styles “Comment Reference” through “Strong” are built-in character styles that cannot be deleted. That pertains to Word 2003 and are probably many others for later versions. Even though the Style Copier is not deleting, perhaps there is something about these and other undeletable styles that conflict with the copy code. If I click the "Show All Styles, INCLUDING Built-Ins" option from the test Headings 1-2 file (272 in all) and try to copy all of them to a file, your error trap removes all but 60 of them. If I click the "Show Only Styles in Use" option, I get 60 styles. I didn't compare the two lists, but I bet they're the same.

I just noticed one issue with the Target Files box (Listbox3). The intention is to allow one to select files from one or more drives, but once files have been selected, invoking the Open File button (Sub CmdTarget_Click) overwrites whatever file names are already in Listbox3 (actually it overwrites the number of items in the listbox with the number of files selected, going to to bottom). I need to retain these and append the newly selected files, but can't work out the code for that. Can you help with that?

I've attached the latest version so you can see the changes (I haven't addressed cleaning up the format or aligning the object in the form yet; just want to get the code working properly for now).
Attached Files
File Type: doc Style Copier Application (Jan 11 2012).doc (110.0 KB, 23 views)
Reply With Quote