#1
|
|||
|
|||
Macro Needed To Convert Text in Word to Plain Text and Back to Word
I have a word macro enable file (name is "Original") that has a lot of formating on it and would like to save it in plain text format.
After this I would like to copy back the plain text format into the same word document (if possible--by erasing the old content in the original file) I'm having a lot of issues trying to take out all the formatting from the original document. What I'm doing right now is to save the content in plain text to notepad, erase the content on the word file and copy back the text information that is in notepad and copy back to the word file. I would like to know if someone can help automating these steps. Your help is appreciated. Cheers! |
#2
|
||||
|
||||
Have you tried Ctrl-A, Ctrl-X, Paste Special>Text Only?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
||||
|
||||
Or perhaps CTRL+A, CTRL+Q, CTRL+Space and format Normal style
Code:
Sub Reset() Selection.WholeStory Selection.Font.Reset Selection.ParagraphFormat.Reset Selection.Style = ActiveDocument.Styles("Normal") End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#4
|
|||
|
|||
Thank you both for your responses. I appreciate it.
Macropod--I recorded a macro based on your instructions and is doing what I want. GMayor--After running your code, is setting everything to normal except that the document have some text highlighted in various colors but the colors stays in the document, and would like the colors not to be there anymore. Thanks again! |
#5
|
||||
|
||||
Add the line
Code:
Selection.Range.HighlightColorIndex = wdNoHighlight
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#6
|
|||
|
|||
Hi Graham,
Thanks for the additional line. It does the job. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
I need to convert shaded text into highlighted text on about 80 different long documents. VBA macro? | AustinBrister | Word VBA | 8 | 05-28-2015 02:42 PM |
Convert image-text hybrids into plain text | morlack | Excel | 4 | 12-03-2014 05:29 PM |
Word now only pasting in plain text | RobertSF | Word | 6 | 04-28-2012 08:51 PM |
My plain text post got converted to rich text in a reply, how to convert it back? | david.karr | Outlook | 0 | 01-05-2012 09:46 AM |
Word only pastes plain text | seskanda | Word | 6 | 02-19-2010 10:01 AM |