Results 1 to 8 of 8
  1. #1
    3 Star Lounger
    Join Date
    May 2001
    Location
    Berkeley, California, USA
    Posts
    214
    Thanks
    0
    Thanked 0 Times in 0 Posts

    maintain format when inserting file (03 SP2)

    What is the surest way to preserve all formating when inserting one file into another?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: maintain format when inserting file (03 SP2)

    Say you insert document A into document B.
    If document A and document B both contain a style S, text from document A formatted with this style will take on the formatting of S in document B.
    So you'd have to make sure that document A uses different styles than document B.

    BTW, was the answer to <post:=652,701>post 652,701</post:> useful? At the moment, other Loungers reading that thread don't know if the problem has been solved.

  3. #3
    3 Star Lounger
    Join Date
    May 2001
    Location
    Berkeley, California, USA
    Posts
    214
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: maintain format when inserting file (03 SP2)

    Document A is an existing document created some time ago by an unidentified user. Document B recently created by a new user. Both users are entirely ignorant of styles and don't want to know anything about such "arcane" matters. They just want me to insert one into the other without any changes in formatting. In this most recent occurence the one file is being appended to the end of the other.

    perhpas another method other than inserting the file would work better?

    Is there any way to simply "lock" all of the formating in one file and insert it into the other? Is there any way to de-link the formatting from styles?

    I appreciate your "BTW" in the previous post. I was not sure if it was considered good form to post a thank you, or other response. I have often wanted to post a "thank you" or "yeah That worked" but i was afraid it would be taking up space wtihout adding any real information.

    I did post a response in that thread. Yes that worked perfectly.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: maintain format when inserting file (03 SP2)

    If all formatting was applied directly instead of through styles, simply inserting the document may well preserve all formatting. I'd try it - if it doesn't work out the way you want, you only need to close the document without saving it.

    Posting a short "Yeah that worked" or similar serves two purposes:
    - For other Loungers: if you have a question, it's quite possible that others will have the same question at some time in the future. Many Loungers search the forum before posting. It's useful if they can see whether a reply solved the problem.
    - For the one who replied: if I know that a reply worked, I can give the same reply in the future, or refer to it. Otherwise, I'm left guessing.

  5. #5
    3 Star Lounger
    Join Date
    May 2001
    Location
    Berkeley, California, USA
    Posts
    214
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: maintain format when inserting file (03 SP2)

    That did not work. I inserted a section break and then inserted the file. The margins and fonts changed to the format of the original document.

    As a practical matter I went through and reformatted the inserted portion. It only took about 10-15 minutes. But since this comes up from time to time around here I was hoping to find some bullet proof technique.

    I may experiment with inserting it in a frame. But I am afraid future users will go nuts if they want to make a change.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: maintain format when inserting file (03 SP2)

    That's why people should take a bit of time to learn how to use styles.. But even that is not going to solve the problem completely. (But who would want a document where the fonts and margins shift all the time because it was written by several authors? <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>)

  7. #7
    3 Star Lounger
    Join Date
    May 2001
    Location
    Berkeley, California, USA
    Posts
    214
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: maintain format when inserting file (03 SP2)

    "Ours not to reason why, ours but to ... " <img src=/S/blush.gif border=0 alt=blush width=15 height=15>

  8. #8
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: maintain format when inserting file (03 SP2)

    The bulletproof way of doing this is to ensure that the styles being pasted into the existing document do not already exist with a different definition in the target document.

    For instance, if pasting from doc B into doc A
    1. Rename ALL styles in doc B by appending a letter to the start of each stylename eg ChapterHead becomes bChapterHead
    2. Copy the content of doc B
    3. Paste into doc A

    Note: over the long term this will become messier and messier and you will have to get more and more creative on your renaming patterns unless you regularly clean files. You will also need to include section breaks around the text you are copying if you want to bring page setups and header/footers across with the paste.

    Having said this, you will discover that you can't just rename the built-in styles - Word is too clever for that. You will need to come up with a strategy to deal with this. One way would be to create new styles based on those built-in styles. Another way might be to export the doc B to xml and change the style names using a text editor before doing the copy and paste.

    Whilst this is doable via automation with macros it is not something most Word specialists would want to do since normally you strive to make documents consistent rather than develop large amounts of code to make documents inconsistent.

    A quick and dirty approach would be to maintain both files separately - which is what you already have.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

Posting Permissions

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