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 / August 2006

Tip: Looking for answers? Try searching our database.

Insert Unicode Characters Into Code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Diamonds_Mine - 14 Aug 2006 16:04 GMT
In my macro, I need to insert the following text:  "Liczba stron łącznie z
tytułową".  However, I need assistance with inserting the special characters
that are being used.  When I copy/paste the text from a Word document, some
of the characters become question marks.  This is the code:

Selection.TypeText "Liczba stron ??cznie z tytu?ow?:"
           ActiveDocument.Bookmarks("lblFipo").Select

Thank you for any assistance you can provide.
Dave Lett - 14 Aug 2006 16:16 GMT
Hi,

You will need to know the unicode character number for each of the special
characters that you're trying to insert. You can select each special
character and use the following to get the unicode character:

MsgBox AscW (Selection.Text)

which returns 322 for the l character

Therefore, if I want to insert the first word in your example, I would use
something like the following:

Selection.InsertSymbol CharacterNumber:=322, Unicode:=True
Selection.InsertSymbol CharacterNumber:=261, Unicode:=True
Selection.TypeText "cznie"

HTH,
Dave

> In my macro, I need to insert the following text:  "Liczba stron lacznie z
> tytulowa".  However, I need assistance with inserting the special
[quoted text clipped - 7 lines]
>
> Thank you for any assistance you can provide.
Klaus Linke - 14 Aug 2006 21:24 GMT
> In my macro, I need to insert the following text:  "Liczba stron lacznie z
> tytulowa".  However, I need assistance with inserting the special
[quoted text clipped - 7 lines]
>
> Thank you for any assistance you can provide.

You could also crank up the macro recorder, paste the text in "Edit > Find",
and do a search.
That should give you a string to work with, something like
"Liczba stron " & ChrW(322) & ChrW(261) & "cznie z tytu" & _
        ChrW(322) & "ow" & ChrW(261)

Klaus
 
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.