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

Re: Remove forward slash when in first character of first line of docu by Jezebel

Jezebel
Mon Sep 11 20:48:02 CDT 2006

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



"snsd" <snsd@discussions.microsoft.com> wrote in message
news:96988AC1-5D8D-461B-A044-035FBE0699B8@microsoft.com...
> 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



Re: Remove forward slash when in first character of first line of by snsd

snsd
Fri Sep 15 17:36:01 CDT 2006

EXACTLY what I was looking for.

Thanks a million.

Dave

"Jezebel" wrote:

> If ActiveDocument.Characters(1) = "/" Then
> ActiveDocument.Characters(1).Delete
> End If
>
>
>
> "snsd" <snsd@discussions.microsoft.com> wrote in message
> news:96988AC1-5D8D-461B-A044-035FBE0699B8@microsoft.com...
> > 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
>
>
>