![]() |
#1
|
|||
|
|||
![]()
Hi, this is my first post and I'm a VBA novice, so please have patience with me.
I'm trying to find and highlight duplicate sentences in a Word 2013 document, and I found this script http://stackoverflow.com/questions/1...-word-document. Option Explicit Sub Sample() Dim MyArray() As String n = 0 '~~> Sort the arrayEnd Sub However, on certain documents I get the "Run-time error '5854': String parameter too long." error on the "Selection.Find.Execute itm" command. Yet, when I look at the offending sentence, although it has more than 255 characters, there are many more, longer sentences which the macro processes normally. There are no hidden characters / formatting marks, and there are duplicate sentences after that particular sentence. If I break the offending sentence in two, the macro runs fine. Any idea how I should modify the script? Kind regards, George |
Tags |
duplicate sentences, vba script |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
navyguy | Word | 2 | 01-03-2014 12:48 PM |
![]() |
shahin3121 | Word | 2 | 03-05-2012 06:16 PM |
![]() |
Michael007 | Word VBA | 3 | 01-17-2011 04:11 PM |
Finding where I last worked on a document. | Balliol | Word | 1 | 11-24-2010 04:50 AM |
Saving Word document creates a duplicate transparent file | bbailey | Word | 0 | 12-05-2009 10:54 PM |