PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
Style issues when merging the word documents-VBForums
Results 1 to 5 of 5

Thread: Style issues when merging the word documents

  1. #1

    Thread Starter
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    Style issues when merging the word documents

    Hi Guys,

    I am facing style issues when merging the documents. If you find any solutions for that pls update me. Herewith I attached three documents Doc1.doc, Doc2.doc and Merged.doc.

    In Doc1, we have a Style named "BodyText" with the following formatting: AllCaps, Underline. Similarly in Doc2 also we have a style named "BodyText" with the following formatting: Bold, Centered, not AllCaps, Not Underline.

    When Merging these documents, I opened the First Document Doc1 and then using insert file optio from insert menu I merged the Doc2 with Doc1 and I save as the file as Merged.doc. I wondered that the Style "BodyText" in Doc2 formatting has been replaced by the Doc1 "BodyText" style formatting. So, Is there any solution to merge the document without any style issues?

    Pls post your ideas/comments.

    Thanks,

    CS.
    Attached Files Attached Files

  2. #2
    Lively Member
    Join Date
    Apr 2005
    Posts
    103

    Re: Style issues when merging the word documents

    Maybe a macro to change the names of all the styles in Doc2 before adding them to Doc1? That way one style won't be overwritten by another.
    Something like this (to be run on doc2);
    VB Code:
    1. Sub RenameStyles()
    2.  
    3. Dim sStyle As Style
    4.  
    5. For Each sStyle In ActiveDocument.Styles
    6.     sStyle.NameLocal = "_" & sStyle.NameLocal
    7. Next sStyle
    8.  
    9. End Sub

    I'm not sure how well that works, as it only changes the local name. I don't know if it's possible to change its actual name, but it can't hurt to give it a try
    You can also expand the macro so it does the merging of the documents automatically.

  3. #3
    Lively Member
    Join Date
    Apr 2005
    Posts
    103

    Re: Style issues when merging the word documents

    This might work either.

    VB Code:
    1. For Each sStyle In ActiveDocument.Styles
    2.            Application.OrganizerRename _
    3.             Source:=ActiveDocument.Name, Name:=sStyle.Namelocal, _
    4.             NewName:="_" & sStyle.Namelocal, _
    5.             Object:=wdOrganizerObjectStyles
    6. Next sStyle

  4. #4

    Thread Starter
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    Re: Style issues when merging the word documents

    Quote Originally Posted by pickarooney
    Maybe a macro to change the names of all the styles in Doc2 before adding them to Doc1? That way one style won't be overwritten by another.
    Something like this (to be run on doc2);
    VB Code:
    1. Sub RenameStyles()
    2.  
    3. Dim sStyle As Style
    4.  
    5. For Each sStyle In ActiveDocument.Styles
    6.     sStyle.NameLocal = "_" & sStyle.NameLocal
    7. Next sStyle
    8.  
    9. End Sub

    I'm not sure how well that works, as it only changes the local name. I don't know if it's possible to change its actual name, but it can't hurt to give it a try
    You can also expand the macro so it does the merging of the documents automatically.
    Thank you for you kind help! but this code is not working properly. If I run this macro the Heading styles are changing differently. the heading styles are changing to bulleted (Numbering) style. This code will not work for me.

  5. #5

    Thread Starter
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    Re: Style issues when merging the word documents

    Quote Originally Posted by pickarooney
    This might work either.

    VB Code:
    1. For Each sStyle In ActiveDocument.Styles
    2.            Application.OrganizerRename _
    3.             Source:=ActiveDocument.Name, Name:=sStyle.Namelocal, _
    4.             NewName:="_" & sStyle.Namelocal, _
    5.             Object:=wdOrganizerObjectStyles
    6. Next sStyle
    This code is not working. I don't know Why? It says "Run time error '4149' File Not found".

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width