Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / September 2006

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
snsd - 12 Sep 2006 02:40 GMT
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
Jezebel - 12 Sep 2006 02:48 GMT
If ActiveDocument.Characters(1) = "/" Then
   ActiveDocument.Characters(1).Delete
End If

> 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
[quoted text clipped - 20 lines]
>
> End With
snsd - 15 Sep 2006 23:36 GMT
EXACTLY what I was looking for.

Thanks a million.

Dave

> If ActiveDocument.Characters(1) = "/" Then
>     ActiveDocument.Characters(1).Delete
[quoted text clipped - 24 lines]
> >
> > End With
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.