PDA

View Full Version : Please help me with vba code - cant find the Error



Kalii
04-09-2018, 11:17 AM
Hi,

I wrote a macro that finds and replace ("marks") all bold, itlaic, underlined and highlighted words in a document. It "marks" the wirds by setting a specific characters before and after the word, so Word will find the words again, when i copy and paste in a new document with pasting "Text only".

I am very sad because it is just not working 100% also i spent so many hours to get it working....

It opens the dialogue which is asking if it should start the serch from the beginning instead of simply replacing all.
When there are words that are bold, italic AND highlighted it is makking the following paragraph completely bold instead of only making the one word bold, itali and highlighted!


Here is a link to the code (it is acually to long to post it in the thread :()

https://justpaste.it/1jefl


And I have another quesion, too: Is it possible to turn off hyphention in the document with a vba-code?

Thanks very very much in advanced!!!

macropod
04-09-2018, 03:40 PM
Cross-posted (and answered) at: http://www.msofficeforums.com/word-vba/38729-vba-find-replace-all-bold-itlaic-underlined.html
Please read VBA Express' policy on Cross-Posting in item 3 of the rules: http://www.vbaexpress.com/forum/faq.php?faq=new_faq_item#faq_new_faq_item3