Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 10th, 2004, 01:42 PM
Authorized User
 
Join Date: Jun 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default SuperScript

I'm working a function for creating a superscript character in rich text and I can't seem to get it to work. Can someone help me with this? I'm making it for an A2K application and I'm limited to using only MS Rich Textbox Control 6.0.

Code:
=========================================
Private Sub btnSuperScript_Click()
    RichTextBox1.SelRTF = SuperScriptRTF(RichTextBox1.SelText, 9)
End Sub

----------------------------------------------
Private Function SuperScriptRTF(strText As String, Optional FontSize As Long = 9) As String
    ' fs<x> represents font size, where <x> is twice the required point size
    Dim fs As String

    fs = "fs" & (2 * FontSize)
    SuperScriptRTF = "{\rtf1\super\" & fs & " " & strText & "}"
End Function
=========================================

Thanks,
PC
 
Old June 15th, 2004, 01:37 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,093
Thanks: 1
Thanked 12 Times in 11 Posts
Default

Good luck. As you may already be aware, your code works perfectly in a VB6 app. Access can't seem to get its act together with the RICHTX32.ocx., and a handful of others. If you upgrade to A2K3, for example, you'll get an annoying message that Access doesn't even support the Rich TextBox control. Don't mean to hijack your thread, but has anybody seen a fix for that yet??? I saw a post on this forum from several months back suggesting uninstall/reinstall using regsvr32. No luck. Nothing in the knowledge base yet.

Bob

 
Old June 15th, 2004, 02:50 PM
Authorized User
 
Join Date: Jun 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The only ideas to offer you are these. I hope they work for you. If I find anything else I'll post it in this thread. Let me know if this helps.

Microsoft Knowledge Base Article - 824165
ActiveX control that is contained in an Access form does not appear when the design-time license is not available
http://support.microsoft.com/default...b;en-us;824165

Access ActiveX Fix
http://www.access-programmers.co.uk/...achmentid=5967
http://www.access-programmers.co.uk/...803#post275803

++++++++++++++++++++++++++++++++++++++++++++++++++ ++++
As for my topic, I tried making some adjustments to the code and if anyone can tell me why this doesn't work and how to get it to work I would appreciate it.

Code:
================================================== ====
Public Function SuperScript()
    Dim strItem As String
    Dim strScript As String
    strItem = Forms![fdlgRTFEditor]![RichText].SelText
    strScript = "\cf0\super" & strItem & "\cf1\nosupersub"
    Forms![fdlgRTFEditor]![RichText].SelText = strScript
End Function

Public Function SubScript()
    Dim strItem As String
    Dim strScript As String
    strItem = Forms![fdlgRTFEditor]![RichText].SelText
    strScript = "\cf0\sub" & strItem & "\cf1\nosupersub"
    Forms![fdlgRTFEditor]![RichText].SelText = strScript
End Function
================================================== ====

Thanks much,
PC





Similar Threads
Thread Thread Starter Forum Replies Last Post
using superscript in XML bcogney XML 6 May 4th, 2008 02:45 AM
superscript in reporting service yaseen Crystal Reports 0 March 29th, 2007 02:12 AM
Superscript Date Format r_taduri Crystal Reports 1 July 3rd, 2006 02:55 PM
Superscript in XML Bhavana.t XML 8 March 2nd, 2006 06:09 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.