OberonPlace.com Forums  

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

Thread Tools Search this Thread Display Modes
Old 23-11-2004, 10:22
Posts: n/a
Default Reading Font Properties from selected text in CD9

I’m not a programmer, but I am attempting a CD9 program that allows the user to select text from the graphics window so that those font properties can be used later in the program. So, I need to store the font properties such as name, size, and style of the selected text into variables for later use.

Currently I have been able to get the name and size using CorelScript functions GetTextFontName and GetTextFontSize, but I can’t find the script function that lets me get the font style. Better yet, how to use VBA to get the name, size, and style of the selected text instead of using script. I have tried using:

Dim MyFontName As String

I have been able to set these properties, but not read them. What is the correct syntax for this?

Thanks in advance,
Reply With Quote
Old 23-11-2004, 19:57
Alex's Avatar
Alex Alex is offline
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default Re: Reading Font Properties from selected text in CD9

Have you tried to reference the text object directly instead if hoping that the selection shape will return the text properties?

FontName = ActiveDocument.Selection.Shapes(1).Text.FontProperties.Name

I don't have CorelDRAW 9 installed, so I can't test this. But I would suggest you to move to at least CorelDRAW 10 as it has much more advanced object model. But you would really appreciate the power and completeness of object model in CorelDRAW 11 and 12....
Reply With Quote
Old 24-11-2004, 07:59
Posts: n/a

Thanks, that worked great. I agree a newer version of CorelDraw would be better. I wrote the program for my in-laws who own a small trophy and plaque shop. It is very small and v9 is all they can afford right now. They will probably stick with what they have until an increase in productivity would justify the upgrade.

Thanks again, and by the way, this is the best VBA for CorelDraw site I have seen anywhere.

Reply With Quote

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
Text ENCODE Craig Tucker CorelDRAW/Corel DESIGNER VBA 10 26-01-2005 13:59
format text dialog box implement graphicdesigner CorelDRAW/Corel DESIGNER VBA 5 22-12-2004 13:37
Reset text after text compression. Bellekom CorelDRAW/Corel DESIGNER VBA 2 05-05-2004 06:14
Text selection problem ken_ac CorelDRAW/Corel DESIGNER VBA 2 10-02-2004 20:24
Paragraph text like Ingredient List d-signer CorelDRAW/Corel DESIGNER VBA 2 22-01-2004 21:59

All times are GMT -5. The time now is 08:10.

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