Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Attribute VB_Name = "Module2"
- Public Function Seg(a As String, b As String, c As Integer)
- Dim selectedText As String
- Dim hhhg, selRange As Range
- Set hhhg = ActiveDocument.Range
- With hhhg.Find
- .Text = a
- .MatchWholeWord = True
- hhhg.Find.Execute
- hhhg.Collapse direction:=wdCollapseEnd
- JUEWEUIFFH = "uhw k2jh4j3k gkjgh23 kg23 jh23g423hjfg 3gh2fe3"
- Set selRange = ActiveDocument.Range
- YQWGUDJADG = "kh2 3ke3j32 gh2hgd32hdg"
- selRange.Start = hhhg.End
- .Text = b
- .MatchWholeWord = True
- .Execute
- hhhg.Collapse direction:=wdCollapseStart
- selRange.End = hhhg.Start
- If (c = 1) Then
- selectedText = selRange.Delete
- End If
- If (c = 2) Then
- selRange.Font.Color = wdColorBlack
- End If
- If (c = 3) Then
- With hhhg.Find
- .Text = a
- .Replacement.Text = ""
- .Wrap = wdFindContinue
- .Execute Replace:=wdReplaceAll
- End With
- End If
- End With
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement