Dim FirstPos, SecPos, a, c, d As Integer
Dim E As String
Private Sub CommandButton1_Click()
a = CInt(TextBox1.Text)
b = TextBox2.Text
c = 0
d = 0
markieren
End Sub
Sub markieren()
While c = 0
d = d + 1
FirstPos = -1
SecPos = -1
ActiveDocument.Range(0, 0).Select
Do While FirstPos = -1 Or SecPos = -1
With Selection.Find
.ClearFormatting
.Font.Size = a
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
If Not Selection.Find.Found Then
c = 1 2)
Exit Do
End If
If FirstPos = -1 Then
FirstPos = Selection.Start
ElseIf SecPos = -1 Then
SecPos = Selection.Start
End If
Loop
If FirstPos <> -1 And SecPos <> -1 Then
Selection.Start = FirstPos
Selection.End = SecPos
End If
If c = 0 Then 1)
Selection.Cut 3)
Documents.Add Template:="", NewTemplate:=False, DocumentType:=1
Selection.Paste
E = Str(d)
ChangeFileOpenDirectory "C:\martin\
HTML\"
ActiveDocument.SaveAs FileName:=E + ".htm", FileFormat:=wdFormatHTML, _
LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword _
:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _
SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _
False
ActiveWindow.Close
Else
Selection.WholeStory
Selection.Cut
Documents.Add Template:="", NewTemplate:=False, DocumentType:=1
Selection.Paste
E = Str(d)
ChangeFileOpenDirectory "C:\martin\
HTML\"
ActiveDocument.SaveAs FileName:=E + ".htm", FileFormat:=wdFormatHTML, _
LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword _
:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _
SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _
False
ActiveWindow.Close
End If
Wend
End Sub