?
Solved

Subscript and Unicode text to the Word from VB

Posted on 2003-03-05
3
Medium Priority
?
341 Views
Last Modified: 2008-02-01
It's seem to me very difficult.

I created a Word Document from VB.
Now I want to insert some text ,for example "Ak".
But to insert "k" subscript . How can I do it from VB.

And maybe somebody know how to insert also Unicode char to the word from VB.(for example U+2113 -small l)

Please ,help me !
0
Comment
Question by:irina_1973
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 5

Expert Comment

by:bullethead
ID: 8070579
Something like this should give you the idea.

Sub Insert_Text()

Dim appWd As Word.Application
Set appWd = GetObject(, "Word.Application")
   
With appWd.Selection
    .TypeText Text:="A"
    .Font.Subscript = wdToggle
    .TypeText Text:="k"
    .Font.Subscript = wdToggle
End With

End Sub

Not sure about the Unicode char, to insert it using the Decimal ASCII code you can use Chr, for example:

Selection.TypeText Chr(105)
0
 
LVL 2

Accepted Solution

by:
lvngstn earned 400 total points
ID: 8073533
Here's a small sample routine for printing some Unicode characters.  

Sub InsertSomeSymbols()
  Dim i As Long
  For i = 8000 To 8025
    Selection.InsertSymbol CharacterNumber:=i, _
                           Unicode:=True, _
                           Font:="Arial Unicode MS", _
                           Bias:=0
  Next i
End Sub


You get the idea...

lvngstn
0
 
LVL 2

Expert Comment

by:lvngstn
ID: 8138551
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question