Re: Copy all misspelled words by rj
rj
Thu Nov 30 01:49:09 CST 2006
Hey thanks so much bru..
On Nov 29, 10:40 pm, "Greg Maxey" <gma...@mvps.org> wrote:
> Sorry for the last post. I am clearly a scatter brain today.
>
> Greg Maxey wrote:
> > Karl,
>
> > I had come up with this earlier before I started exploring the class
> > method:
>
> > Sub ListErrorsNoDups()
> > Dim oErr As Word.Range
> > Dim oCol As Collection
> > Dim i As Long
> > Dim bDup As Boolean
> > Set oCol = New Collection
> > For Each oErr In ActiveDocument.Range.SpellingErrors
> > bDup = False
> > For i = 1 To oCol.Count
> > If oCol(i) = oErr Then bDup = True
> > Next i
> > If Not bDup Then oCol.Add oErr
> > Next
> > Documents.Add
> > For i = 1 To oCol.Count
> > ActiveDocument.Range.InsertAfter oCol(i) & vbCr
> > Next i
> > End Sub
>
> > I like you method better.
>
> > Would you have anything that demonstrated this raise and sink events
> > idea that you mentioned?
>
> > Greg Maxey wrote:
> > > If you don't want to use the code in my weblink then a simple version
> > > would be:
>
> > > Sub ListErrorsAllowDups()
> > > Dim oErr As Word.Range
> > > Dim oCol As Collection
> > > Dim i As Long
> > > Set oCol = New Collection
> > > For Each oErr In ActiveDocument.Range.SpellingErrors
> > > oCol.Add oErr
> > > Next
> > > Documents.Add
> > > For i = 1 To oCol.Count
> > > ActiveDocument.Range.InsertAfter oCol(i) & vbCr
> > > Next i
> > > End Sub
>
> > > Sub ListErrorsNoDups()
> > > Dim oErr As Word.Range
> > > Dim oCol As Collection
> > > Dim i As Long
> > > Dim bDup As Boolean
> > > Set oCol = New Collection
> > > For Each oErr In ActiveDocument.Range.SpellingErrors
> > > bDup = False
> > > For i = 1 To oCol.Count
> > > If oCol(i) = oErr Then bDup = True
> > > Next i
> > > If Not bDup Then oCol.Add oErr
> > > Next
> > > Documents.Add
> > > For i = 1 To oCol.Count
> > > ActiveDocument.Range.InsertAfter oCol(i) & vbCr
> > > Next i
> > > End Sub
>
> > > rj wrote:
> > > > Hi All,
>
> > > > I have a large document (over 1000 pages) and want to copy all the
> > > > misspelled words and paste them in new document (1 below the other)
> > > > how can this be done? I am using Word 2003.
>
> > > > Thanks in advance :)