OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-07-2010, 22:01
ager ager is offline
Member
 
Join Date: Jul 2010
Location: Russia
Posts: 45
Default Superscript and Subscript

Don't work text position option in VBA code. For example, if I try to execute this code in VBA (CorelDraw X4):

Sub Test()
Dim d As Document
Dim s As Shape
Dim t As Text
Set d = CreateDocument
Set s = d.ActiveLayer.CreateParagraphText(2, 2, 4, 4, "This is an example.")
Set t = s.Text
t.Story.Words.First.Position = cdrSuperscriptFontPosition
End Sub

Run-time error appear, but if I write t.Story.Words.First.Position = cdrSubscriptFontPosition
(instead Superscript, like in VBA help) i have no error.
Reply With Quote
  #2  
Old 03-07-2010, 23:38
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,790
Blog Entries: 13
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default Superscript

I can confirm this is a bug. You can work around it by using the older FontPropertiesInRange:

Code:
Sub Test()
    Dim d As Document
    Dim s As Shape
    Dim t As Text
    Dim lngCount As Long
    
    Set d = CreateDocument
    Set s = d.ActiveLayer.CreateParagraphText(2, 2, 4, 4, "This is an example.")
    Set t = s.Text

    lngCount = t.Story.Words.First.Characters.Count
    t.FontPropertiesInRange(1, lngCount).Position = cdrSuperscriptFontPosition
End Sub
-Shelby
Reply With Quote
  #3  
Old 04-07-2010, 02:43
ager ager is offline
Member
 
Join Date: Jul 2010
Location: Russia
Posts: 45
Default Re: Superscript

Shelbym! Thank you very much, it works
But bug is really exist, may be it had been fixed in CorelDraw X5 .
Reply With Quote
  #4  
Old 04-07-2010, 12:34
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,790
Blog Entries: 13
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default X5

Not fixed in X5, that was the version I was using to confirm the issue.

-Shelby
Reply With Quote
  #5  
Old 12-02-2022, 13:31
Plixo Plixo is offline
Junior Member
 
Join Date: Oct 2011
Location: Singapore
Posts: 19
Default X8, 64 bits, not fixed

And your work-around still works.

Thanks Shelby, saved my day, one more time
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Superscript and Subscript JudyHNM CorelDRAW/Corel DESIGNER VBA 1 13-11-2007 17:45


All times are GMT -5. The time now is 02:48.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com