Private Type My_Index GetSelectedText As Integer End Type Private Type this a As My_ArcObjects Message As String Index As My_Index End Type '======================================================= ' SpellCheck '======================================================= Public Function Spellcheck() Dim Word As New Class_Word Dim text As Variant GetSelectedText_Reset While (GetSelectedText(this.a.ITextElement)) text = this.a.ITextElement.text Call Word.Spellcheck(text) this.a.ITextElement.text = text Wend Set Word = Nothing this.a.IMxDocument.ActiveView.Refresh End Function '======================================================= ' GetSelectedText '======================================================= Public Function GetSelectedText(ITextElement As ITextElement) GetSelectedText = False If ((this.Index.GetSelectedText + 1) > this.a.IGraphicsContainerSelect.ElementSelectionCount) Then Exit Function Set ITextElement = this.a.IGraphicsContainerSelect.SelectedElement(this.Index.GetSelectedText) this.Index.GetSelectedText = this.Index.GetSelectedText + 1 GetSelectedText = True End Function '======================================================= ' GetSelectedText_Reset '======================================================= Public Function GetSelectedText_Reset() If this.a.IMxDocument.ActiveView Is this.a.IMxDocument.PageLayout Then Set this.a.IGraphicsContainerSelect = this.a.IMxDocument.PageLayout Else Set this.a.IGraphicsContainerSelect = this.a.IMxDocument.FocusMap End If this.Index.GetSelectedText = 0 End Function