J
julian_m
What i'm looking for, is a macro which finds every occurrence of
certain string, and delete the text which follows it (in the same line)
for instance, given this text:
bla bla bla //this should be removed
bla bla bla //this should be removed
bla bla bla //this should be removed
After executing the macro, I'd want to have
bla bla bla
bla bla bla
bla bla bla
I tried with the following code, expecting that it would find "//"
every time this string is in the text, but it actually doesn't do the
job
With ActiveDocument.Content.Find
.ClearFormatting
.Style = wdStyleHeading3
.Text = "//"
Do While .Execute(Forward:=True, Format:=True) = True
MsgBox "se encontró //"
Loop
End With
I'm really new in VBA, so any tips would be apreciated
tnx - jm
certain string, and delete the text which follows it (in the same line)
for instance, given this text:
bla bla bla //this should be removed
bla bla bla //this should be removed
bla bla bla //this should be removed
After executing the macro, I'd want to have
bla bla bla
bla bla bla
bla bla bla
I tried with the following code, expecting that it would find "//"
every time this string is in the text, but it actually doesn't do the
job
With ActiveDocument.Content.Find
.ClearFormatting
.Style = wdStyleHeading3
.Text = "//"
Do While .Execute(Forward:=True, Format:=True) = True
MsgBox "se encontró //"
Loop
End With
I'm really new in VBA, so any tips would be apreciated
tnx - jm