PC Review


Reply
Thread Tools Rate Thread

Chemical formula with sub/superscript in TextBox, Label etc.

 
 
Christian
Guest
Posts: n/a
 
      8th May 2007
Hi there,

At the moment I'm working on program for chemical calculations.
I created a Userform with a lot of TextBoxes and Labels for data
input.

Problem: I can't find a way to display chemical formulars (e. g. H20:
the "2" must be subscript) correctly in a textbox.caption or
label.value

Is there a way to enabel subscript or superscript for single
characters in a caption or label?

Thanx in advance for any advice,

- Christian

 
Reply With Quote
 
 
 
 
NickHK
Guest
Posts: n/a
 
      8th May 2007
Christian,
In order to use such text formats, you need a control that supports Rich
Text Format.
The RTF box does.

Note that I now get an error "The subject is not trusted for the specified
action" when trying to use this control. AFAIK, this is the result of an
update.
A quick unregister then register of this control fixed it. If you get this
problem, maybe these will help:

http://support.microsoft.com/kb/827742
http://p2p.wrox.com/topic.asp?whichp...OPIC_ID=10894&

NickHK

"Christian" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi there,
>
> At the moment I'm working on program for chemical calculations.
> I created a Userform with a lot of TextBoxes and Labels for data
> input.
>
> Problem: I can't find a way to display chemical formulars (e. g. H20:
> the "2" must be subscript) correctly in a textbox.caption or
> label.value
>
> Is there a way to enabel subscript or superscript for single
> characters in a caption or label?
>
> Thanx in advance for any advice,
>
> - Christian
>



 
Reply With Quote
 
GysdeJongh
Guest
Posts: n/a
 
      8th May 2007
"Christian" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi there,
>
> At the moment I'm working on program for chemical calculations.
> I created a Userform with a lot of TextBoxes and Labels for data
> input.
>
> Problem: I can't find a way to display chemical formulars (e. g. H20:
> the "2" must be subscript) correctly in a textbox.caption or
> label.value


Hi Christian,
you need the Rich Textbox (Richtx32.ocx) instead of the Text Box.The problem
is that the Rich Textbox is nolonger trusted

See the discussions here (Remove the carriage returns inserted in the long
URL by the news reader) :

http://groups.google.co.uk/group/mic...b649c569bb5369

http://groups.google.com/group/micro...b012e5230d7a81

Maybe you can use one of these :
Newsgroups: microsoft.public.excel.programming
From: Perico <Per...@discussions.microsoft.com>
Date: Mon, 19 Jun 2006 14:03:01 -0700
Local: Mon, Jun 19 2006 11:03 pm
Subject: RE: Problem with RICHTX32.OCX

I had this problem. The solution for me was to use the msMask32.ocx
instead.

Newsgroups: microsoft.public.excel.programming
From: "RB Smissaert" <bartsmissa...@blueyonder.co.uk>
Date: Fri, 5 May 2006 23:06:07 +0100
Local: Sat, May 6 2006 12:06 am
Subject: Re: Problem with RICHTX32.OCX

If you are interested I can mail you a RichTextBox control that behaves just
like the regular one but doesn't have this security problem.

RBS

hth
Gys


 
Reply With Quote
 
Jan Karel Pieterse
Guest
Posts: n/a
 
      8th May 2007
Hi Christian,

> Is there a way to enabel subscript or superscript for single
> characters in a caption or label?


No.

You could do this (character formatting I mean) with a textbox on a
dialogsheet way back in Excel 5. Excel still supports these dialog
sheets though.

Otherwise you'd have to use third party controls I think.

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com
Member of:
Professional Office Developer Association
www.proofficedev.com

 
Reply With Quote
 
Jon Peltier
Guest
Posts: n/a
 
      8th May 2007
A different approach is to find a font specifically designed with sub- and
superscripted numerals up where other infrequently used characters are
usually found. Here's the first link returned in a Google search:

http://www.chemsoc.org/networks/learnnet/RSCfont.htm

You could use this utility to figure out which character code provides the
appropriate character:

http://peltiertech.com/Excel/tricks.html#ascii

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Christian" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi there,
>
> At the moment I'm working on program for chemical calculations.
> I created a Userform with a lot of TextBoxes and Labels for data
> input.
>
> Problem: I can't find a way to display chemical formulars (e. g. H20:
> the "2" must be subscript) correctly in a textbox.caption or
> label.value
>
> Is there a way to enabel subscript or superscript for single
> characters in a caption or label?
>
> Thanx in advance for any advice,
>
> - Christian
>



 
Reply With Quote
 
=?Utf-8?B?UEJlenVjaGE=?=
Guest
Posts: n/a
 
      9th May 2007
Hi Christian,

I'd propose an additional diversion: accepting the inability of
sub-/superscript input, and, for the next treatment, using the procedure,
which converts numerals correctly. If you like, I'm able to mail a well-tried
sub.

Regards
--
Petr Bezucha


"Christian" wrote:

> Hi there,
>
> At the moment I'm working on program for chemical calculations.
> I created a Userform with a lot of TextBoxes and Labels for data
> input.
>
> Problem: I can't find a way to display chemical formulars (e. g. H20:
> the "2" must be subscript) correctly in a textbox.caption or
> label.value
>
> Is there a way to enabel subscript or superscript for single
> characters in a caption or label?
>
> Thanx in advance for any advice,
>
> - Christian
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to type a subscript above a superscript like chemical element Gesiggie Microsoft Word Document Management 1 3rd Feb 2008 05:10 PM
How do I write a chemical formula, such as H20 =?Utf-8?B?V2hhdCBpcyBhIGRpc3BsYXkgbmFtZT8=?= Microsoft Word Document Management 8 6th Oct 2006 01:09 AM
Use a formula to populate a label from a textbox damorrison Microsoft Excel Misc 5 4th Sep 2006 01:30 PM
How to insert subscript & superscript as in chemical symbols =?Utf-8?B?R3JhY2U=?= Microsoft Word New Users 4 4th Oct 2005 01:08 PM
Chemical formulas & sub/superscript problems =?Utf-8?B?ZHJhZ29uZmlyZTcwNw==?= Microsoft Word Document Management 4 29th Oct 2003 11:27 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:59 AM.