Results 1 to 10 of 10
  1. #1
    New Lounger
    Join Date
    May 2001
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Can't we improve on Paste Special Unformatted? (All)

    Frankly, I'm a little sick of "Paste Special Unformatted Text" as a solution to contamination of a document when you paste in content from another source. It certainly doesn't handle tables, it puts fixed numbers in instead of headings, etc.

    "Profiler" from DocTools can help clean up some of this mess (no good on the tables, but useful for re-heading-izing and reapplying bullet styles), but there are waaaaay to many ways to mess up a doc by pasting.

    Word really needs a "Paste Using Current Formatting" so that styles in the current doc would apply to the pasted item, not the other way 'round.

    One thing that would help is if there were some way to tell where the clipboard came from: If it's Word, was it created in the same template? If not, ask the user if they want to paste unformatted. I did some peeking at a saved Scrap file to see if I could find this info out. Unfortunately, the template name does not appear to be stored in the clipboard. It might be possible that a style name private to your document (but never used?) could be 'picked' out of the data of the clipboard: If it's there, we can assume clean. This still isn't easy to implement.

    The only other thing I can think of is to implement a "Paste Quarantined Text." I haven't tried this, it just occurred to me while typing. It'd have to be something like the following pseudo-VBA:

    savedTmplt = activedocument.attachedtemplate.fullname
    Documents.Add
    selection.paste
    ActiveDocument.AttachedTemplate = savedTmplt
    activedocument.updatestyles
    ' maybe add code to remove section breaks?
    activedocument.range.select
    activedocument.close false
    selection.paste

    I'll have to see how that works. It's ugly, because it pops up another window, but it just might work.

    Joel Finkle
    Pharmacia Corporation

  2. #2
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,048
    Thanks
    124
    Thanked 119 Times in 116 Posts

    Re: Can't we improve on Paste Special Unformatted? (All)

    Word does have a paste using current (target document) formatting. It is called using styles. If styles were used in the source document and the same styles are used in the target document then the formatting of the pasted text will take on the appropriate formatting in the target document.

    The thing is, people use direct formatting to paragraphs that are formatted using styles. Often the direct formatting is a toggle for the style formatting. This leads to bizarre results like paragraphs in all bold italic.

    It is a problem in that people (author included) don't want to learn to use styles. I resisted for years and now regret every day of those years because although that string was still very hard to push, it kept getting longer and longer, and had some very important projects tied to it! Once you understand styles and the Word concept of organizing things into Chinese boxes everything falls into place and instead of pushing a string, you can push a button that turns on the very powerful text processing machine known as Microsoft Word and it will start doing your work for you instead of running around behind you trying to undo what you just thought you did. See <A target="_blank" HREF=http://www.addbalance.com/usersguide/styles.htm> Understanding Styles</A> (addbalance.com/usersguide/styles.htm) for more on this.
    Charles Kyle Kenyon
    Madison, Wisconsin

  3. #3
    New Lounger
    Join Date
    May 2001
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Can't we improve on Paste Special Unformatted? (All)

    Charles,
    We are already educating people on styles as strongly as we can possibly do so.

    But the behavior we see appears different from how you describe. Text copied from one styled document and pasted into another document based on a different template can cause the document receiving the paste to CHANGE ITS STYLES!

    This doesn't happen in simple cases (I've just tested it myself), but it certainly happens often. I'm not sure what the 'trigger' is to cause this problem, but I'm certain it occurs. My guess is that it's happening when copying from documents containing some corruption.

    Boy this sounds like old wives' tales, urban legends and just plain poppycock. But I won't recant.

    I wish I had some of my 'bad' examples to post (I'll see if I can dig 'em out). At the very least, the list template for Heading styles gets carried with the clipboard, rather than absorbing the existing document's numbering/bulleting scheme -- that I've just tested, and does cause problems.

    Joel

  4. #4
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,048
    Thanks
    124
    Thanked 119 Times in 116 Posts

    Re: Can't we improve on Paste Special Unformatted? (All)

    Examine every style (source and target) using the "Modify" button on the styles dialog. Uncheck anything saying "automatically update." Just a guess.
    Charles Kyle Kenyon
    Madison, Wisconsin

  5. #5
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Can't we improve on Paste Special Unformatted? (All)

    Hi Joel:
    >>Text copied from one styled document and pasted into another document based on a different template
    >>can cause the document receiving the paste to CHANGE ITS STYLES!

    I've never seen this happen. What CAN happen it that if you paste text into a paragraph that has direct formatting, or if the pasted text has direct formatting, the formatting for that paragraph can change. However, depending how the style is defined, changing another style in the document may change the pasted style.

    I copied a post some time ago that was written by John McGhie that's interesting.

    Edited. Originally posted by John McGhie, Word MVP
    When you copy an outline from one document to another, you will notice that styles Heading 1 through Heading 6 assume the style in the target document but Heading 7, 8 and 9 do not appear to. Heading 9 behaves differently than the rest.

    A fresh blank document contains only headings 1 to 3 plus Normal and a character style called Default Paragraph Font.

    To investigate the effect of this, do the following. (You need to do this with a fresh new Normal.dot to see the effect. Professional authors who have changed their Normal templates properly won't see the effect. Rename your Normal.dot and allow Word to create a new default template.)

    Now apply styles Heading 1 to 9.

    On a totally default Normal.dot template in Word 2000, if you then set the Font of Normal style to 24 point and Red, you will get a very entertaining result:

    ALL the headings will turn red. This is because the color is not defined in ANY of the styles.

    Headings 1 to 6 and 9 will remain the correct size, and turn red.

    Headings 7 and 8 will turn red and go to 24 point.

    To understand what is going on, go to Format/Style and check the definition for each style.

    You will see that both the Font and Size are explicitly set for Headings 1 through 6.

    For Heading 7, neither the font nor the size is set: it just appears at whatever font Normal style has. The only thing defined for that style is space above and below.

    For Heading 8, the font and size are not defined, but the face is set to Italic. You get large italic text when you change Normal style.

    For Heading 9, both font and size are set, so you get only the red color.

    Word is doing the right thing, but the author of the default template has been distinctly sloppy. Word is faithfully following the rule that a change to the property of a higher-ranked style affects all styles that are based upon that higher ranked style unless that property is explicitly defined in the dependent style.

    So if you define a Font in Normal style, that font will flow through to every style based upon Normal that does not have the font defined. For Headings 1 to 6, the font is defined, breaking the link. But if you specify a color, that's not defined in any style, so it flows through.

    Now, when you copy the text, what happens follows the same rule. But it ALSO follows the rule that: "Copied text ADDS the style if it is not already used in the document, or ADOPTS it if it is."

    So if you now take your red headings, copy them, create a new blank document, and paste them: red headings. If you look in the Style definitions: the font property is set to red.

    However, if you prepare a NEW blank document, and place Headings 1 through 9 in it, with their default format, THEN copy the red headings in, the headings will all go black. The incoming text adopts the format of the target document's styles because they have already been used.

    To see this graphically, create a third blank new document. Create in it only Headings 1 through 5, formatted according to their defaults. Now copy into it your red headings. Headings 1 through 5 are black, headings 6 through 9 are red!

  6. #6
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Can't we improve on Paste Special Unformatted? (All)

    Since Woody just beat the drum for "Paste Special Unformatted" (Office Watch #6.45) it's good to keep some drawbacks in mind, even if most of these limitations are expected and don't usually make problems.
    (I use Word2000)

    Only regular Unicode characters will survive (and not even all of those, see below):

    Symbols from decorative fonts like "Symbol" or "Wingdings" are changed to regular characters (you have to reapply the font).

    Most of the control characters (code below 32) are deleted or changed:
    especially annoying: you loose the conditional hyphen (31, Ctrl-Hyphen).
    The non-breaking hyphen 30/&H1E (Ctrl-Shift-Hyphen) is changed to 64979/&HFDD3 (possibly a special character used in Arabic texts?).

    Some other characters are changed:
    manual line break (11) to paragraph mark (13),
    page/column/section breaks to blank + paragraph mark,
    most others are changed to blanks.

    The non-breaking space (160) and the for-per-em-space (8197) are changed to normal spaces (32) (no apparent reason for that!?!).
    The characters 172 and 182 (not-sign and paragraph sign) are deleted, also for no apparent reason at all (perhaps bad luck for resembling the formatting characters "optional hyphen" and "paragraph mark").
    Some other characters of less importance are also deleted (8203, 8204, 8205, 65279).

    BTW: Both "PasteSpecial > Unformatted Text" or "PasteSpecial > Unformatted Unicode Text" seem to do exactly the same thing in Word2000.


    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>Klaus

  7. #7
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Can't we improve on Paste Special Unformatted? (All)

    Heavens, take a VBA shortcut:

    <pre>Sub StylesNoUpdate()
    Dim aStyle As Style
    For Each aStyle In ActiveDocument.Styles
    If aStyle.Type = wdStyleTypeParagraph Then
    If aStyle.AutomaticallyUpdate = True Then
    aStyle.AutomaticallyUpdate = False
    Debug.Print aStyle.NameLocal & " updated"
    End If
    End If
    Next
    End Sub</pre>


    I ran it on a document and got this in my immediate window:

    Index 1 updated
    Index 2 updated
    Index 3 updated
    Index 4 updated
    Index 5 updated
    Index 6 updated
    Index 7 updated
    Index 8 updated
    Index 9 updated
    List Bullet updated
    List Bullet 2 updated
    List Bullet 3 updated
    List Bullet 4 updated
    List Bullet 5 updated
    TOC 1 updated
    TOC 2 updated
    TOC 3 updated
    TOC 4 updated
    TOC 5 updated
    TOC 6 updated
    TOC 7 updated
    TOC 8 updated
    TOC 9 updated

    Good. Mostly stuff I don't care about. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  8. #8
    New Lounger
    Join Date
    May 2001
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Can't we improve on Paste Special Unformatted? (All)

    Thanks to all who have replied.

    We're converts to the pure true flame of Styles in Word
    * We do train in the use of styles
    * We don't have "automatically update"

    But I still swear that we've seen docs get screwed up by copying text from other-styled docs. If I can get a definitive example, I'll post it.

    I can verify that heading numbering formats (theStyle.ListTemplate) gets PRESERVED when pasted, meaning that suddenly, you'll have headings with a different numbering scheme. My PasteQuarantined code I posted does not fix this -- I'll have to do some more experimenting.

    Joel

  9. #9
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Can't we improve on Paste Special Unformatted? (All)

    Hi Joel,

    Numbering is notoriously buggy. Mostly this is caused by the fact that the numbering isn't saved in the styles, but only attached to them.
    This also makes problems when copying between documents. The list template with attached styles can only be copied between documents if the styles connected to that list template don't already exist in the new document.
    In the case of heading styles, they generally are already present, and the list template gets ruined.

    John McGhie just posted his version of <A target="_blank" HREF=http://groups.google.com/groups?th=f725710438e20573>"How to cure Word's List Numbering with a dose of VBA"</A>. I only just started to look into it; seems very good.

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>Regards, Klaus

  10. #10
    Lounger
    Join Date
    Oct 2001
    Location
    Mentor, Ohio, USA
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Can't we improve on Paste Special Unformatted? (All)

    Hi! I am new at this and new to your site. But I have had a complaint about what I refer to as invisible or hidden format changes for a long time. I could not do anything and there were "bigger fish to fry," so I "back-burnered" it; but this conversation brought it back to mind.

    A long time ago, you could see formatting (on an info bar I believe it was) as your cursor was over/on/in it. WordPerfect allows you to view formatting in a separate window which I find difficult to use because everything is on that screen all the time. I know about "shift/F1" in Word and that is nice if you want to see the formatting for something in particular and you know that there is a format change there. But there are times when (I don't know about you, but ) I would like to know or be aware that there was a formatting change. It would sure be nice to be able to get back the ability to see this invisibe/hidden formatting again--at least, I think so.

    If anyone knows of anywhere else I should address this issue or anywhere else this issue is addressed, feel free to contact me. Or contact me if I can clarify what I am (from a simple user's point of view) trying to say.

    P.S. I'm a word processing user from about 20 years ago when word processing is all word processors did. Personally, my favorite word processor was the IBM PCS (?-it's been a long time, I think that was the name). You could toggle from the word processor to using the printer as a typewriter--a secretary's heaven, but today's printers can't be used that way. Anyway, I've seen quite a bit of change and have contacted IBM any times and have seen that things I contacted them about were changed--obviously not just because I was the only one who mentioned it. My point is that I think this is a great means of communication. Keep it up.

Posting Permissions

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