Replacing special characters and symbols in word documents.

Posted on 2004-10-17
Last Modified: 2010-05-02
Is there any VB script for replacing special characters & symbols like chr(172).
Question by:micazone
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
  • 2
LVL 48

Expert Comment

ID: 12332063

Accepted Solution

_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)
OutString = Replace(Instring, chr(0), "")


Author Comment

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.

Author Comment

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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

730 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