Ich hoffe ich bin hier richtig?
Ich möchte gern folgende unkommentierten Code "Erstes Wort nach Punkt und Doppelpunkt groß", den ich im Netz gefunden, habe verwenden(keine Ahnung ob er funktioniert):
Sub CapsAfterColonAndFullStop()
With Selection.Find
.ClearFormatting
.Text = ": ([a-z])"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute
While .Found
Selection.Range.Case = wdUpperCase
Selection.Collapse Direction:=wdCollapseEnd
.Execute
Wend
.Text = ". ([a-z])"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = True
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute
While .Found
Selection.Range.Case = wdUpperCase
Selection.Collapse Direction:=wdCollapseEnd
.Execute
Wend
End With
End Sub
Mein Eigenes Programm beginnt mit:
Sub Makro1()
Dim objStream As Object
Dim text1 As String
Datei = Dir(Pfad & "*.html")
Set objStream = CreateObject("ADODB.Stream")
objStream.Type = 2
objStream.Charset = "utf-8"
objStream.Open
objStream.LoadFromFile (Pfad & Datei)
text1 = objStream.ReadText()
objStream.Close
'Und hier soll der Gefundene Code folgen.
End Sub
Aber wie?
Selection = text1 'funktioniert nicht
Mit freundlichen Grüßen
tl1000sm1234