[mso] Re: Word 2002: Convert Number To String

Hi again Cathy,

There is a function called CStr which supposedly converts an
expression to a string. Maybe that would work.

String = CStr(Expression)

It's in the help.

Also, one way to tell if it is a string is that the str functions
stick a space on the front. Do a trim$ after the str. The trim$ also
returns a string and won't work if the argument is a number. As a last
ditch attempt I would try adding an empty string to the front of it
with doodad = "" & string/number. One way to have 650,000.00 is to use
a different notation maybe... SI units would probably use "650
000.00". The space there would make it look like a string to VBA.

Do the numbers have units like meters/miles or something? Perhaps you
could put the units on the end or at the front if it's currency. That
would definately make it a string.

If you deliberately make it a string does the code work... replace the
variable with a text string like "650090". If it still comes out a
number then it can't be the variable but something is doing an extra
conversion somewhere *after* you've converted it to a string.

HTH
Lisa


> Thanks Lisa.  A straw can be good . . . there is progress,
> 650,000.00
> changed to 650000.00, it removed the comma, but still kept
> it at numerical,
> so I know at least it is finding the right instance of the
> bookmark, just
> whether I have added the Str$ in the right way.  Here is
> what I changed:
>
>          Dim strPrice As String
>          strPrice = Str$(tbxPrice)
>          UpdateBookmarkProc "bkPrice1", strPrice
>
> I have also been searching the web and find some public
> functions that
> people put in their code, and am testing to see if adding
> one of them will
> be the missing part.  I'm not giving up yet!  Thank you again, Cathy
>


*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, send an email to 
mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes) in 
the subject line.

Or, visit the group's homepage and use the dropdown menu.  This will also allow 
you to change your email settings to digest or vacation (no mail).
http://www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send a 
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with 
instructions.  Once you are a member of the files group, you can go here to 
upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************

Other related posts: