Thema Datum  Von Nutzer Rating
Antwort
18.06.2016 12:53:10 heiwela
Solved
18.06.2016 14:02:54 Gast66599
NotSolved
18.06.2016 15:16:15 Gast79429
NotSolved
18.06.2016 17:49:52 heiwela
NotSolved
Rot Makro zum Ändern der Schriftfarbe
18.06.2016 19:23:04 Gast89922
NotSolved
19.06.2016 14:36:59 heiwela
NotSolved
19.06.2016 16:26:15 Gast7117
NotSolved
19.06.2016 16:51:16 Gast7117
NotSolved
19.06.2016 17:59:16 heiwela
NotSolved
20.06.2016 10:35:46 heiwela
NotSolved

Ansicht des Beitrags:
Von:
Gast89922
Datum:
18.06.2016 19:23:04
Views:
845
Rating: Antwort:
  Ja
Thema:
Makro zum Ändern der Schriftfarbe

Hallo,

ah ja Deinen Switch-Effekt hab ich etwas zu vorschnell entfernt :oops: , das Einfügen Deiner Liste  kannst Du vereinfachen, indem Du vorher die Cases mit Kommata in Word mit der Suchen/Ersetzen Funktion ersetzt und dann einfach in das Array reinkopierst:

Option Explicit
 
Public Sub Fuellwoerter()
Dim objWort As Range
Dim avntArray() As Variant
Dim enmFontColor As WdColor
Dim ialngIndex As Long
avntArray = Array("aber", "abermals", "ich") '// hier Deine Wörterliste reinkopieren...
For Each objWort In ActiveDocument.Words
    For ialngIndex = 0 To UBound(avntArray)
        With objWort
            If avntArray(ialngIndex) = LCase(Trim$(.Text)) Then
                If .Font.Color = wdColorWhite Then
                   enmFontColor = wdColorAutomatic
                Else
                   enmFontColor = wdColorWhite
                End If
                Exit For
            End If
        End With
    Next
    If ialngIndex <= UBound(avntArray) Then Exit For
Next
For Each objWort In ActiveDocument.Words
    For ialngIndex = 0 To UBound(avntArray)
        With objWort
            If avntArray(ialngIndex) = LCase(Trim$(.Text)) Then
               .Font.Color = enmFontColor
               Exit For
            End If
        End With
    Next
Next
End Sub

Gruß,


Ihre Antwort
  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen
Thema: Name: Email:



  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen

Thema Datum  Von Nutzer Rating
Antwort
18.06.2016 12:53:10 heiwela
Solved
18.06.2016 14:02:54 Gast66599
NotSolved
18.06.2016 15:16:15 Gast79429
NotSolved
18.06.2016 17:49:52 heiwela
NotSolved
Rot Makro zum Ändern der Schriftfarbe
18.06.2016 19:23:04 Gast89922
NotSolved
19.06.2016 14:36:59 heiwela
NotSolved
19.06.2016 16:26:15 Gast7117
NotSolved
19.06.2016 16:51:16 Gast7117
NotSolved
19.06.2016 17:59:16 heiwela
NotSolved
20.06.2016 10:35:46 heiwela
NotSolved