Remove forward slash when in first character of first line of docu

S

snsd

Hi: Thanks to the help of a number of you on this site, the following code
successfully replaces the occurrence of a forward slash that is preceded by
one or more spaces with a highlighted space. I would like to create code that
would remove the occurrence of a forward slash if it is the first character
in the first line of the document. Any ideas?

'Removes / proceeded by a space and replaces with a highlighted space

Dim rDcmForwardSlash As Range

Set rDcmForwardSlash = ActiveDocument.Range

With rDcmForwardSlash.Find

.Text = " @/"
.Replacement.Highlight = True
.Replacement.Text = " "
.MatchWildcards = True
.Execute Replace:=wdReplaceAll

End With
 
J

Jezebel

If ActiveDocument.Characters(1) = "/" Then
ActiveDocument.Characters(1).Delete
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top