Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Word
application.errors
conversions
docmanagement
drawing.graphics
formatting.longdocs
international
internet.assistant
mail
mailmerge.fields
menustoolbars
newusers
numbering
oleinterop
pagelayout
printingfonts
setup.networking
spelling.grammar
tables
vba.addins
vba.beginners
vba.customization
vba.general
vba.userforms
web.authoring
word6-7macros
word97vba
  
 
date: Sun, 28 Sep 2008 16:27:01 -0700,    group: microsoft.public.word.vba.general        back       


Encoding in Documents.Open   
I have a substantial number of text documents that I open in Word (2003) and 
do some processing on.  To get started, I recorded a macro that opened a 
file, did a couple of things to it, and closed it.  I have made several 
additions to the macro and tested it over the last couple of weeks.

A couple of days ago, I noticed that the file that Word opened did not have 
any dashes or apostrophes in it that were in the original text file.  I 
played with it for a while, but eventually I recorded another macro, and this 
time the dashes and apostrophes were included.

In the original macro, the 'Encoding' parameter was set as 65001; in the 
most recent recording, the parameter was set to 1252.

The 'Help' in the VBA Editor talks about Encoding, and msoEncoding, as 
relating to character sets, but always in terms of names, not numbers.  Is 
there any information somewhere that tells what number matches with what name?

-- 
Bill @ UAMS
date: Sun, 28 Sep 2008 16:27:01 -0700   author:   BillCPA Bill @ UAMS

Re: Encoding in Documents.Open   
On Sun, 28 Sep 2008 16:27:01 -0700, BillCPA <Bill @ UAMS> wrote:

>I have a substantial number of text documents that I open in Word (2003) and 
>do some processing on.  To get started, I recorded a macro that opened a 
>file, did a couple of things to it, and closed it.  I have made several 
>additions to the macro and tested it over the last couple of weeks.
>
>A couple of days ago, I noticed that the file that Word opened did not have 
>any dashes or apostrophes in it that were in the original text file.  I 
>played with it for a while, but eventually I recorded another macro, and this 
>time the dashes and apostrophes were included.
>
>In the original macro, the 'Encoding' parameter was set as 65001; in the 
>most recent recording, the parameter was set to 1252.
>
>The 'Help' in the VBA Editor talks about Encoding, and msoEncoding, as 
>relating to character sets, but always in terms of names, not numbers.  Is 
>there any information somewhere that tells what number matches with what name?

In the VBA editor, display the Object Browser (F2) and search for the term
'encoding'. You'll get a list of all the members of the MsoEncoding enumeration,
and when you click on one you'll see its numeric value in the bottom pane.

For the values you mentioned, 65001 is msoEncodingUTF8 and 1252 is
msoEncodingWestern.


--
Regards,
Jay Freedman
Microsoft Word MVP        FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.
date: Sun, 28 Sep 2008 20:25:04 -0400   author:   Jay Freedman

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us