Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Subscript and Unicode text to the Word from VB

Posted on 2003-03-05
3
Medium Priority
?
350 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
  • 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

Industry Leaders: 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

With its various features, Office 365 can not only help you with your day-to-day business tasks, it can also do wonders for your marketing campaign.
In this post, I will showcase the steps for how to create groups in Office 365. Office 365 groups allow for ease of flexibility and collaboration between staff members.
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

564 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