Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-17-2015, 03:58 PM
rsrasc rsrasc is offline Macro Needed To Convert Text in Word to Plain Text and Back to Word Windows 7 64bit Macro Needed To Convert Text in Word to Plain Text and Back to Word Office 2010 64bit
Competent Performer
Macro Needed To Convert Text in Word to Plain Text and Back to Word
 
Join Date: Mar 2014
Location: Germany
Posts: 148
rsrasc is on a distinguished road
Default 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!
Reply With Quote
  #2  
Old 12-17-2015, 05:24 PM
macropod's Avatar
macropod macropod is offline Macro Needed To Convert Text in Word to Plain Text and Back to Word Windows 7 64bit Macro Needed To Convert Text in Word to Plain Text and Back to Word Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Have you tried Ctrl-A, Ctrl-X, Paste Special>Text Only?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 12-17-2015, 10:36 PM
gmayor's Avatar
gmayor gmayor is offline Macro Needed To Convert Text in Word to Plain Text and Back to Word Windows 10 Macro Needed To Convert Text in Word to Plain Text and Back to Word Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
Reply With Quote
  #4  
Old 12-18-2015, 02:29 AM
rsrasc rsrasc is offline Macro Needed To Convert Text in Word to Plain Text and Back to Word Windows 7 64bit Macro Needed To Convert Text in Word to Plain Text and Back to Word Office 2010 64bit
Competent Performer
Macro Needed To Convert Text in Word to Plain Text and Back to Word
 
Join Date: Mar 2014
Location: Germany
Posts: 148
rsrasc is on a distinguished road
Default

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!
Reply With Quote
  #5  
Old 12-18-2015, 05:32 AM
gmayor's Avatar
gmayor gmayor is offline Macro Needed To Convert Text in Word to Plain Text and Back to Word Windows 10 Macro Needed To Convert Text in Word to Plain Text and Back to Word Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Add the line
Code:
Selection.Range.HighlightColorIndex = wdNoHighlight
before End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #6  
Old 12-18-2015, 07:13 AM
rsrasc rsrasc is offline Macro Needed To Convert Text in Word to Plain Text and Back to Word Windows 7 64bit Macro Needed To Convert Text in Word to Plain Text and Back to Word Office 2010 64bit
Competent Performer
Macro Needed To Convert Text in Word to Plain Text and Back to Word
 
Join Date: Mar 2014
Location: Germany
Posts: 148
rsrasc is on a distinguished road
Default

Hi Graham,

Thanks for the additional line.

It does the job.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro Needed To Convert Text in Word to Plain Text and Back to Word 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
Macro Needed To Convert Text in Word to Plain Text and Back to Word 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

Other Forums: Access Forums

All times are GMT -7. The time now is 02:47 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft