organizercopy problem - destroys format

R

rootd

Hi!

I am using organizercopy to copy the styles from a template to a
document. this works fine, but the format e.g. font inside the document
gets corrupted. how can I prevent that?

I use:

For Each currstyle In ActiveDocument.Styles
If currstyle.Type = wdStyleTypeCharacter Or wdStyleTypeParagraph Then
Application.OrganizerCopy Source:=sourcedocname, _
Destination:=destdocname, _
Name:=currstyle, _
Object:=wdOrganizerObjectStyles
' Object:=currstyle.Type
End If
Next currstyle


thanks in advance

hans
 
J

Jezebel

This line is wrong --

currstyle.Type = wdStyleTypeCharacter Or wdStyleTypeParagraph

This is testing .type against (wdStyleTypeCharacter Or wdStyleTypeParagraph)
ie 3. So you're looking through all the style in your current document
looking for *tablestyles* (type = 3).
 
R

rootd

ok, but I still have no clue what to do now. actually what I want to do
is to copy the format styles e.g. hyperlinks, headers etc to the
current document.
could you tell me how please?

thanks
 
J

Jezebel

The line should be

If currstyle.Type = wdStyleTypeCharacter Or currstyle.Type =
wdStyleTypeParagraph

but there's nothing in the code -- even with the bug -- that would be
causing the corruption you describe.
 
R

rootd

ok thanks for answer, but as you wrote it didn't fix my problem. I have
no idea anymore. thanks tho
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top