Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Word > Word VBA

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 10-12-2018, 11:17 AM
mdbguy mdbguy is offline Windows 10 Office 2013
Novice
 
Join Date: Oct 2018
Posts: 2
mdbguy is on a distinguished road
Default Format text in Word to look like code in VBA editor


I have miles of Excel VB code written by a long-gone predecessor. It's bad. Needs to be refactored.

I like to copy code into Word so it's easier to manipulate. But I'd like to colorize it like VB code, comments green, keywords blue, that sort of thing. Being unfamiliar with the Word object model, I thought I'd ask for a boost.

I need basic syntax to find all occurrences of a given string and change the color. I think I can handle the rest. Thanks so much!
Reply With Quote
  #2  
Old 10-12-2018, 11:39 AM
mdbguy mdbguy is offline Windows 10 Office 2013
Novice
 
Join Date: Oct 2018
Posts: 2
mdbguy is on a distinguished road
Default Nevermind

Thanks anyway...I got it.
Reply With Quote
  #3  
Old 10-13-2018, 03:02 AM
slaycock slaycock is offline Windows 7 64bit Office 2016
Expert
 
Join Date: Sep 2013
Posts: 255
slaycock is on a distinguished road
Default

If you are trying to refactor VBA code then RubberDuck is a strong ally.

http://rubberduckvba.com/
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Word MergeField Code Text issue stevenel Mail Merge 17 09-27-2018 09:12 PM
creating a code to create dynamic text in word ah8471 Word VBA 1 12-29-2015 10:52 PM
Macro to select an { includepicture } field code and format the picture behind text and 100% scale sanpedro Word VBA 3 03-30-2015 10:50 PM
VBA code for Microsoft Word macro select text and insert footnote ndnd Word VBA 10 01-06-2015 01:47 PM
VBA code to format a document containing tables rasika99 Word VBA 3 12-12-2014 04:16 AM


All times are GMT -7. The time now is 11:48 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft