Live-Forum - Die aktuellen Beiträge
Datum
Titel
24.04.2024 19:29:30
24.04.2024 18:49:56
24.04.2024 17:19:09
Anzeige
Archiv - Navigation
204to208
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
204to208
204to208
Aktuelles Verzeichnis
Verzeichnis Index
Verzeichnis Index
Übersicht Verzeichnisse
Inhaltsverzeichnis

WORD SpellCheck in EXCEL

WORD SpellCheck in EXCEL
21.01.2003 19:52:18
Andreas K.
Hallo Zusammen,

Ich habe folgendes Skript auf der Microsoft Homepage gefunden. Mit dessen Hilfe gelingt es die Word-Rechtschreibpruefung in Excel anzuwenden.

Private Function SpellIt()
Dim wdApp As Word.Application
Dim wdDoc As Document
Dim rngRange As Range
Dim rngCell As Range

Application.DisplayAlerts = False

Set wdApp = New Word.Application

Set rngRange = Application.Selection

If IsEmpty(rngRange) Then
If ActiveSheet.UsedRange.Count < 650000 Then
Set rngRange = ActiveSheet.UsedRange
Else
MsgBox "Please select a range to spell check or use " _
& "the Excel spelling checker to scan the entire sheet."
Application.DisplayAlerts = True
Exit Function
End If
End If

For Each rngCell In rngRange
If Not IsEmpty(rngCell) Then
Set wdDoc = wdApp.Documents.Add

wdApp.Selection.Text = rngCell
wdApp.Dialogs(wdDialogToolsSpellingAndGrammar).Show

If Len(wdApp.Selection.Text) <> 1 Then
rngCell.Value = wdApp.Selection.Text
Else
wdDoc.Close wdDoNotSaveChanges
wdApp.Quit
Set wdApp = Nothing
Application.DisplayAlerts = True
Exit Function
End If
wdDoc.Close wdDoNotSaveChanges
End If
Next

wdApp.Quit
Set wdApp = Nothing
Application.DisplayAlerts = True
MsgBox "Spelling check complete. Number of cells checked: " _
& rngRange.Count, , "Word 97 Spelling Checker"
End Function


Private Function SpellOptions()
Dim wdApp As New Word.Application
Dim wdDoc As Word.Document

Application.DisplayAlerts = False

Set wdDoc = wdApp.Documents.Add
wdApp.Dialogs(wdDialogToolsOptionsSpellingAndGrammar).Show

wdDoc.Close wdDoNotSaveChanges
wdApp.Quit
Set wdApp = Nothing
Application.DisplayAlerts = True
End Function

Public Function CreateCommandBar()
Dim cmdBar As CommandBar
Dim cmdSpellCheck As CommandBarButton
Dim cmdSpellOptions As CommandBarButton
Dim tmpBar As CommandBar

For Each tmpBar In Application.CommandBars
If tmpBar.Name = "Spelling Checker" Then
Exit Function
End If
Next

Set cmdBar = Application.CommandBars.Add
cmdBar.Name = "Spelling Checker"

With cmdBar.Controls
Set cmdSpellCheck = .Add(msoControlButton)
Set cmdSpellOptions = .Add(msoControlButton)

With cmdSpellCheck
.Style = msoButtonIconAndCaption
.Caption = "Spelling"
.FaceId = 42
.TooltipText = "Word 97 Spelling Checker"
.OnAction = "SpellIt"
End With

With cmdSpellOptions
.Style = msoButtonIconAndCaption
.Caption = "Options"
.FaceId = 162
.TooltipText = "Word 97 Spelling Checker Options"
.OnAction = "SpellOptions"
End With
End With

cmdBar.Visible = True
End Function

Public Function DestroyCommandBar()
On Error Resume Next
Application.CommandBars("Spelling Checker").Delete
End Function


Es funktioniert an sich ja auch ganz toll, wenn man den Text in die Tabelle einfuegt und dann prueft.
Ich will es aber auf Texte in mehreren TextBoxen beziehen und diese auf Rechtschreibfehler pruefen.
Ich habe schon versucht das Skript umzuschreiben leider ohne Erfolg.
Frage, ist es ueberhaupt moeglich? Wenn ja, wie?

Besten Dank im Voraus!!!

Viele Grusse
Andreas

3
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
Re: WORD SpellCheck in EXCEL
21.01.2003 20:02:10
th.heinrich
hallo Andreas,

da steige ich nicht durch excel hat doch eine eigene.

gruss thomas

Re: WORD SpellCheck in EXCEL
21.01.2003 20:23:49
Andreas
Hi Thomas,

der SpellCheck von Word bietet mehrere Optionen. Man kann z.B. waehlen, ob Woerter in denen Zahlen vorkommen ignoriert werden sollen oder nicht.
Zudem wird bei Word auch die Grammatik gecheckt. Also es bietet mehr features.

Gruss
Andreas

da bin ich leider ueberfordert o.t.
21.01.2003 21:19:04
th.heinrich
.

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige