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

Tip: Looking for answers? Try searching our database.

Replace in a string variable

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Hege M - 04 Jul 2005 15:47 GMT
Hi.  

I am trying to replace space with hard space in i string variable.
I found that space was chr(32) but I haven't been able to find the ascii
code for hard space.  The bookmark is in the footer section so I can't use
ordinary find/replace.

The code I am trying to use is:
   Dim var As String
   Dim ferdig As String
   var = "Hei dette er Hege"
   ferdig = Replace(var, Chr(32), Chr(?), 1, Len(var))
   ActiveDocument.Bookmarks("Test").Range.Text = ferdig

If anyone know what to put insted of ? or have an alternative way of doing
this I would be very grateful.

Hege
Philippe boudreau - 04 Jul 2005 16:22 GMT
Quick Google search gave me this..
...The hard space is ascii character 160 or A0h (hexadecimal) ...

HTH

P.

> Hi.  
>
[quoted text clipped - 14 lines]
>
> Hege
Hege M - 04 Jul 2005 17:45 GMT
Hi!

Great, no it works. Thank you.
(I'll search Google before I ask next time)
Hege

Philippe boudreau skrev:

> Quick Google search gave me this..
> ....The hard space is ascii character 160 or A0h (hexadecimal) ...
[quoted text clipped - 21 lines]
> >
> > Hege
 
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.