SitePoint Sponsor

User Tag List

Results 1 to 24 of 24
  1. #1
    Love *********'s Forum ep2012's Avatar
    Join Date
    Aug 2004
    Location
    Toronto, Ontario
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Copying code from Word to Notepad - still code embedded

    Hi,

    So I just found out from Constant Contact (CC) (my client uses them, I don't LOL) that if I copy her text from her word doc to notepad to clean out the word code, it STILL doesn't remove the code.

    So the CC CSR said I should manually type in the text which is a waste of time.

    I always thought that copying to notepad (I've been doing this for 15 years) strips the code. He's telling me it doesn't.

    Can someone tell me how to strip the code from Word so I can just copy & paste it into CC.

    Thanks


    Michelle

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,319
    Mentioned
    462 Post(s)
    Tagged
    8 Thread(s)
    I my experience, it works fine to copy text from Word and place it in a plain text editor. I can't speak for notepad, but you could just place it into a proper code editor and you should be OK. I sometimes paste such text into the TextEdit app on my Mac, but I have it set to plain text, not rich text etc. So perhaps it's the setting of notepad that make the differece.

    As I say, though, perhaps just bypass notepad and go straight to your code editor.

  3. #3
    SitePoint Enthusiast scout1idf's Avatar
    Join Date
    Nov 2009
    Location
    Ohio
    Posts
    85
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just did some testing and had no problem pasting into Note Pad.

  4. #4
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,892
    Mentioned
    123 Post(s)
    Tagged
    1 Thread(s)
    I've never known Notepad retain anything except plain text. Of course, you don't need to go as far as switching to Notepad - in Word, just go to Paste Special > Unformatted text, and t will strip out any nasties.

  5. #5
    Love *********'s Forum ep2012's Avatar
    Join Date
    Aug 2004
    Location
    Toronto, Ontario
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    I my experience, it works fine to copy text from Word and place it in a plain text editor. I can't speak for notepad, but you could just place it into a proper code editor and you should be OK. I sometimes paste such text into the TextEdit app on my Mac, but I have it set to plain text, not rich text etc. So perhaps it's the setting of notepad that make the differece.

    As I say, though, perhaps just bypass notepad and go straight to your code editor.
    I don't use a code editor, I'm not a website coder, I'm just don't freelance work for a client as her assistant.

    Thanks

  6. #6
    Love *********'s Forum ep2012's Avatar
    Join Date
    Aug 2004
    Location
    Toronto, Ontario
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by scout1idf View Post
    I just did some testing and had no problem pasting into Note Pad.
    Please re-read what I wrote. I never said I had a problem pasting it into Note pad.

  7. #7
    Love *********'s Forum ep2012's Avatar
    Join Date
    Aug 2004
    Location
    Toronto, Ontario
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Stevie D View Post
    I've never known Notepad retain anything except plain text. Of course, you don't need to go as far as switching to Notepad - in Word, just go to Paste Special > Unformatted text, and t will strip out any nasties.
    That's what I said. Now I'm wondering if it's just Constant Contact & not Note Pad. Can someone do a test for me pls. & copy the text from Note Pad to some place to see if there's code behind it.

    Where's this paste special thing? Under what heading?

    Thanks

  8. #8
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,319
    Mentioned
    462 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by 2012 View Post
    I'm not a website coder, I'm just don't freelance work for a client as her assistant.
    This is a web design forum, and you didn't say why you are actually copying this word text and where you are then placing it, so it's natural to assume that you are placing it on a web page—which can be problematic is you have taken the text directly from Word. If not, what are you doing with it? And what "code" are you thinking Word includes? Usually it's just formatting info, and possibly a few extra hidden characters that can mess up a web page if the text isn't cleaned up (by removing all formatting).

    Quote Originally Posted by 2012
    I don't use a code editor
    Many code editors are free, anyway, so they are a nice option if you need a way to clean up text.

  9. #9
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,892
    Mentioned
    123 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by 2012 View Post
    That's what I said. Now I'm wondering if it's just Constant Contact & not Note Pad. Can someone do a test for me pls. & copy the text from Note Pad to some place to see if there's code behind it.

    Where's this paste special thing? Under what heading?
    I have no idea what Constant Contact is, so can't help you with that.

    If you've got Word <2003 it's on the Edit menu, if you've got Word >2007 then click the drop down below the big Paste button (or just Paste normally and then click on the icon that appears by the pasted text for mite options).

  10. #10
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,869
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Are you sure that you are not copying the same Word content into both Notepad and CC? Notepad does not retain any codes so it shouldn't matter what the following program is as long as you COPY/PASTE/COPY/PASTE and don't skip the third step.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  11. #11
    Love *********'s Forum ep2012's Avatar
    Join Date
    Aug 2004
    Location
    Toronto, Ontario
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    This is a web design forum, and you didn't say why you are actually copying this word text and where you are then placing it, so it's natural to assume that you are placing it on a web page—which can be problematic is you have taken the text directly from Word. If not, what are you doing with it? And what "code" are you thinking Word includes? Usually it's just formatting info, and possibly a few extra hidden characters that can mess up a web page if the text isn't cleaned up (by removing all formatting).

    Many code editors are free, anyway, so they are a nice option if you need a way to clean up text.
    Hi Ralph,

    Can you recommend an easy to use code editor.

    The text is going onto CC as I mentioned. CC is a wannabe hosted list creator, they also send out events if you have an event you want to send out. So it doubles as a webpage, but it's hosted on their site.

    As for what code, I have no idea, he just showed me that there was still code in there & there was & I had to manually delete it. The first time I deleted it, I deleted too much, so I spent more time than necessary doing a task that should have taken 20 seconds for me to do.

    Yes I know this forum is for web design, but many entrepreneurs come here as well. I've been coming here for years.

    Thank you


    Michelle

  12. #12
    Love *********'s Forum ep2012's Avatar
    Join Date
    Aug 2004
    Location
    Toronto, Ontario
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    Are you sure that you are not copying the same Word content into both Notepad and CC? Notepad does not retain any codes so it shouldn't matter what the following program is as long as you COPY/PASTE/COPY/PASTE and don't skip the third step.
    Pretty sure. Even if I made the mistake, the CSR told me this happens all the time, so he clearly knew about it.

    So I'm beginning to think it really is on their end <sigh> I hate these poorly coded sites from 10-15 years ago. They NEVER change their code, they hire people who have no clue what they are doing. 1shoppingcart is like that too.

  13. #13
    Love *********'s Forum ep2012's Avatar
    Join Date
    Aug 2004
    Location
    Toronto, Ontario
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Stevie D View Post
    I have no idea what Constant Contact is, so can't help you with that.

    If you've got Word <2003 it's on the Edit menu, if you've got Word >2007 then click the drop down below the big Paste button (or just Paste normally and then click on the icon that appears by the pasted text for mite options).
    Thanks Steve,

    Ok, not sure how it works. It pasted my post to Ralph LOL, I thought I had to highlight the text & then click on paste special & it would show me that it stripped the code, but I guess not. I guess I have to do something else. I'll try to look for instructions.


    Michelle

  14. #14
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,319
    Mentioned
    462 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by 2012 View Post
    Can you recommend an easy to use code editor.
    For PC there are ones like Notepad++ and Notepad2 and for Mac something like TextWrangler.

    When you say there was code from Word that you had to clean up, it would be useful to see an example of what this was. Do you mean just random characters?

  15. #15
    Love *********'s Forum ep2012's Avatar
    Join Date
    Aug 2004
    Location
    Toronto, Ontario
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry for the delay, never got the e-mail notice there was a post.

    So I guess Constant Contact was right in the end. Notepad DOESN'T strip the code from Word.

    I had to submit an article to a blog (not sure what blog software they were using) & sure enough, I went into html & there was Word code in there.

    Not sure how to tell you what code it is other than it was at the bottom & it said Word & there was a lot of it. I'm not a coder, so I can't read it & tell you.

    Could have been the comments that I had inserted in the text much earlier on in the article, it could have been formatting code. I don't know & really don't care, all I care about is the fact that it didn't strip it like I though it was supposed to.

    Not good.

    Now I don't know if this is happening to only software that sucks (this blog software looks really old & dated & of course so is Constant Contact), but even if the software I'm copying to uses old outdated code, that has nothing to do with notepad not stripping it.

    Geeze, just nuts. Now I don't know what to do.

  16. #16
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,869
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Notepad doesn't understand any of the codes so there is no way that it can not strip them out - are you certain that:

    1. you are not getting notepad confused with wordpad (which doesn't strip codes)
    2. That you are copying the text from notepad for the subsequent paste and not just pasting the same content in both places.

    It doesn't matter what you do with the text after pasting it into notepad you will get the same result - the text in notepad is plain text with no codes in it because notepad doesn't support anything except plain text. So if you actually paste text with codes into notepad and then copy the text from notepad you will have plain text to paste to where ever you want to use it.

    If the text you are pasting has codes in it then it wasn't copied FROM notepad.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  17. #17
    Love *********'s Forum ep2012's Avatar
    Join Date
    Aug 2004
    Location
    Toronto, Ontario
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't know what to tell you, I thought like you did until it happened to me again earlier today. This is now the 2nd time.

    1. Yes, I do know the difference between notepad & wordpad. Notepad has a blue icon. I've been using it since 2003 when I switched from WordPerfect to Word & found out that I have to copy all text from Word to notepad otherwise the code comes along with it.

    I have literally 12 notepads open on my computer as we speak for that very purpose as I often copy text from word into TB. It works with TB, but then again, how do I know it works 100% b/c I can't see the html behind TB. I have no clue how to do that since I've never cared before.

    Maybe it only works in TB, but not in other software. I mentioned this possibility earlier.

    2. Of course I'm copying from notepad LOL, I'm not a newbie, I know you have to paste it into notepad & then re-copy.

    Maybe notepad has changed in the last few years. I don't know, I didn't realize this was even an issue until recently.

    Thanks

  18. #18
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,319
    Mentioned
    462 Post(s)
    Tagged
    8 Thread(s)
    Off Topic:

    TB?

  19. #19
    Love *********'s Forum ep2012's Avatar
    Join Date
    Aug 2004
    Location
    Toronto, Ontario
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thunderbird

  20. #20
    SitePoint Enthusiast Grumpy's Avatar
    Join Date
    Oct 2001
    Location
    The Netherlands
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    2012 is right. Notepad in Windows 7, is retaining MS Word formatting.
    I just re-confirmed. :
    I just created a new Word 2010 document, then started a bulleted list with 3 bullets, each with some text. Then Ctrl+A and Ctrl+C.
    Opened a new Notepad, then Ctrl+V in it. The bullets and tab between bullet and text were in tact.
    I hit Ctrl+S to save and the encoding was at ANSI. (The other encodings are Unicode, Unicod big endian, and UTF-8.)
    I saved it with ANSI encoding. But did not get the usual warning that formatting would get lost if I'd continued.
    Then closed and re-opened the same .txt document. All formatting was still there.
    So I went for the ultimate test. I copied some other text to the clipboard to wipe the bulleted list.
    Then Ctrl+A and Ctrl+C on the bulleted list in Notepad, and Ctrl+V into a new MS Word document.
    Result was a perfect bulleted list in my MS Word document.

    P.S. Why does the spellchecker of this forum think that bulleted is wrong?

  21. #21
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,319
    Mentioned
    462 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by Grumpy View Post
    2012 is right. Notepad in Windows 7, is retaining MS Word formatting.
    In TextEdit on Mac, that is the default, but you can turn off all the options for rich text etc. to turn it into a plain text editor if required. Perhap the same with Notepad.

  22. #22
    Love *********'s Forum ep2012's Avatar
    Join Date
    Aug 2004
    Location
    Toronto, Ontario
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well thank gawd someone else confirmed what I've been going through.

    But I'm using Word 2003 just so everyone knows.

    You see I don't save the notepads, I just have tons of them open for this very reason, to copy & paste text from Word or also to re-copy the same text over & over again for other reasons.

    I've been trying to copy it from notepad to another notepad & that didn't cause problems, but now I'm not sure if that was what solved the problem, or it was just b/c I had no bullets in that copy.

    I can't remember now if there was any functions like that when I had issues. I think one situation I didn't have bullets, so I think it happens even when it's just plain text.

  23. #23
    SitePoint Enthusiast Grumpy's Avatar
    Join Date
    Oct 2001
    Location
    The Netherlands
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @ralph.m : Not a chance. This is Windows.
    @2012 : I only saved to see if Notepad would whinge about that there were Unicode or other characters in the text and that formatting would be lost when save with ANSI encoding. (That's what you want to happen in this case.) But it didn't.
    I sometimes use the address bar of any browser to rid off special formatting. Just copy+paste into the address bar. Select the lot in the address bar, and copy+paste from the address bar. But there are limits on the size of the text with this one. Just hit escape to rid off the text and get the URL back.

  24. #24
    SitePoint Enthusiast
    Join Date
    Dec 2007
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can find the 'special paste' command by clicking on the drop down arrow of the 'paste' command at the home tab. I've just tried copying some info with links and other stuffs and use the special paste command to get rid of little nasties.. It works..
    IT Rush <my blog


Bookmarks

Posting Permissions

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