decimal point - strange behaviour macro Word 97 and previous vers ion 
Author Message
 decimal point - strange behaviour macro Word 97 and previous vers ion

hi,
?
in order to "modernize" one of my macros I translated some lines into
VBA. The old lines are still there, as remarks. The user has to enter a
factor. Prices in a document will be multiplied with this factor (but
this has nothing to do with the problem).
The problem is: in the old version, we always used the num block and the
_komma_ of the num block to enter the factor. A message box informed
about the entered factor, in this box, the value was shown with a
decimal _point_. So far so good, everything was always fine. Now, with
the new commands, we have to enter the decimal point with a _point_ on
the keyboard otherwise, the program simply ignores the fraction part of
the factor.
In the system menu, country specifics (or however it's called in
English), everything is set to German language and a komma is choosen as
as deciam point.
Does anybody know where this behaviour of Word comes from and/or have an
idea what has to be done do be able to use the komma on the num block
again?
Thanks a lot in advance for any suggestions.
?
Christian.
Windows NT 4 SR 5 Word 97 SR 2
?
Dim Mulmul As Single
Mulmul = Val(InputBox(Prompt:="Please enter the factor which shall be
used:"))
'Mulmul = WordBasic.Val(WordBasic.[InputBox$]("Please enter the factor
which shall be used:"))
?
'Possibility to abort if the factor has not been entered correctly.
SF = MsgBox("A factor of? " + Str(Mulmul) + " will be used.",
vbDefaultButton1) = vbOK
?
'SF = WordBasic.MsgBox("A factor of " + Str(Mulmul) + " will be used.",
"Please confirm", 1)
If SF = 0 Then GoTo ciao
'End If
Application.Run MacroName:="Putzen"
etc. etc.......


Fri, 19 Jul 2002 03:00:00 GMT  
 decimal point - strange behaviour macro Word 97 and previous vers ion
Hi Christian,

Quote:
> Does anybody know where this behaviour of Word comes from and/or have an
> idea what has to be done do be able to use the komma on the num block
> again?

I know of no way you can alter this setting for Word. There might be a way
using the Windows API to remap the number-block key...

But for the moment, I suggest you try checking what the user types by
intercepting the KeyPress event in a USERFORM (instead of an input box),
or use the INSTR function on Mulmul. Replace any commas with periods, as
they're entered. The user shouldn't notice a thing...

Or, try using the CCur() function instead of Val() to convert the string
to a number. As I recall, in VBA this takes into account the Regional
settings and converts them.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://go.compuserve.com/MSOfficeForum

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)



Fri, 19 Jul 2002 03:00:00 GMT  
 decimal point - strange behaviour macro Word 97 and previous vers ion
Dear Cindy,

Quote:
> Or, try using the CCur() function instead of Val() to convert
> the string
> to a number. As I recall, in VBA this takes into account the Regional
> settings and converts them.

that's it, you recall well. Funny, so few letters to change out of many
thousands and everything's ok now. Thank you very much (again :-)).

Quote:
> But for the moment, I suggest you try checking what the user types by
> intercepting the KeyPress event in a USERFORM (instead of an
> input box),
> or use the INSTR function on Mulmul. Replace any commas with
> periods, as
> they're entered. The user shouldn't notice a thing...

I'll try that out later. Until now I'm not yet familiar at all with
USERFORMS (not to mention using INSTR functions) beeing only on page 80
of Peter Monadjemis book "jetzt lerne ich Visual Basic" :-).

Have a super day and
kind regards
Christian.

Quote:
> -----Ursprngliche Nachricht-----

> Ver?ffentlicht um: Montag, 31. Januar 2000 17:55
> Ver?ffentlicht in: general
> Unterhaltung: decimal point - strange behaviour macro Word 97 and
> previous version
> Betreff: Re: decimal point - strange behaviour macro Word 97 and
> previous vers ion

> Hi Christian,

> > Does anybody know where this behaviour of Word comes from
> and/or have an
> > idea what has to be done do be able to use the komma on the
> num block
> > again?

> I know of no way you can alter this setting for Word. There
> might be a way
> using the Windows API to remap the number-block key...

> But for the moment, I suggest you try checking what the user types by
> intercepting the KeyPress event in a USERFORM (instead of an
> input box),
> or use the INSTR function on Mulmul. Replace any commas with
> periods, as
> they're entered. The user shouldn't notice a thing...

> Or, try using the CCur() function instead of Val() to convert
> the string
> to a number. As I recall, in VBA this takes into account the Regional
> settings and converts them.

> Cindy Meister
> INTER-Solutions, Switzerland
> http://homepage.swissonline.ch/cindymeister
> http://go.compuserve.com/MSOfficeForum

> This reply is posted in the Newsgroup; please post any follow
> question or
> reply in the newsgroup and not by e-mail :-)



Sat, 20 Jul 2002 03:00:00 GMT  
 decimal point - strange behaviour macro Word 97 and previous vers ion
Hi Christian,

Quote:
> I'll try that out later. Until now I'm not yet familiar at all with
> USERFORMS (not to mention using INSTR functions) beeing only on page 80
> of Peter Monadjemis book "jetzt lerne ich Visual Basic" :-).

<G> Glad I remembered the CCur function, then! Bon courage :-)

    -- Cindy



Sat, 20 Jul 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Word 97 Macros > Word XP Macros

2. Help Needed - Passing Value from Access 97 to Word 97 Macro

3. Word 97/how to delete a macro by a macro

4. Word 97: Automatically Making the Previous Month Appear???

5. Word 97: Displaying Previous month with fields???

6. Option Button behaviour in Word 97 forms

7. Word 97: Displaying Previous month with fields???

8. Going from Word 97 to Word 2002 (Macros)

9. My Word 97 macros don't run in Word 2000

10. Word 97 - Userform within Word VBA macro and exchange of values

11. Word 2000 macro running under Word 97

12. Strange behaviour in Word

 

 
Powered by phpBB® Forum Software