Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Replacing special characters and symbols in word documents.

Posted on 2004-10-17
4
250 Views
Last Modified: 2010-05-02
Is there any VB script for replacing special characters & symbols like chr(172).
Shyam
0
Comment
Question by:micazone
  • 2
4 Comments
 
LVL 48

Expert Comment

by:Mikal613
ID: 12332063
0
 
LVL 7

Accepted Solution

by:
_agj_ earned 125 total points
ID: 12336308
do u just want to replace a single character?
 in that case:

OutString = Replace(Instring, chr(172), "")

if u want to take off all non-numeric characters, for eg...

jus have a loop like:

i = 1
while i < len(Instring)
if not IsNUmeric(mid(Instring,i,1)) then mid(Instring,i,1) = chr(0)
wend
OutString = Replace(Instring, chr(0), "")


similiarly
0
 

Author Comment

by:micazone
ID: 12358616
I need to replace multiple special chracters but unfortunately VB does not recognize some of the charcter codes like ChrW(8220), ChrW(960,962,963).
Can u help please with a suitable script.
0
 

Author Comment

by:micazone
ID: 12368392
Thanks,
How to put your code in VB?
Chr(172) not at all being found or replaced by word. Can u solve this please.
Regards
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question