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 / December 2005

Tip: Looking for answers? Try searching our database.

Easy question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
filo666 - 29 Dec 2005 01:34 GMT
1) How to tell word: for each character in the sheet change it to the next
character.
EX. apple chages to: bqqmf

2) if the character is A or B or C or D change it to "Å", goto next character

TIA  
Jean-Guy Marcil - 29 Dec 2005 06:22 GMT
filo666 was telling us:
filo666 nous racontait que :

> 1) How to tell word: for each character in the sheet change it to the
> next character.
[quoted text clipped - 4 lines]
>
> TIA

Try this:

Application.ScreenUpdating = False

Dim i As Long

With ActiveDocument.Characters
   For i = 1 To .Count
       If Asc(.Item(i).Text) = 122 Then
           .Item(i).Text = Chr(97)
       ElseIf Asc(.Item(i).Text) > 96 And Asc(.Item(i).Text) < 122 Then
           .Item(i).Text = Chr(Asc(.Item(i).Text) + 1)
       ElseIf Asc(.Item(i).Text) > 64 And Asc(.Item(i).Text) < 69 Then
           .Item(i).Text = Chr(197)
       End If
   Next
End With

Application.ScreenRefresh
Application.ScreenUpdating = True

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org 

 
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.