OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Corel User Forums > CorelDRAW > Macros/Add-ons

Thread Tools Search this Thread Display Modes
Old 08-09-2011, 01:43
grzjanik grzjanik is offline
Join Date: Mar 2010
Location: Lodz, Poland
Posts: 86
Send a message via Skype™ to grzjanik
Default The name of the font when you change the curves

I work in CorelDraw 12. I have a code that when you change the text to curves as the name of the curve gives the name of the font used and its size in points. You test.

Sub KrzyweOrazNazwaFontu()
Dim s As Shape, sr As ShapeRange
Dim count As Double, strName As String
Dim OrigSelection As ShapeRange
Set OrigSelection = ActiveSelectionRange
count = 1
Set sr = ActiveSelectionRange
For Each s In sr
If s.Type = cdrTextShape Then
strName = s.Text.FontProperties.Name & " (size: " & ActiveShape.Text.FontProperties.Size & " pt)"
s.Name = strName
End If
count = count + 1
Next s
End Sub
I need the help to run code on the entire document (powerclips, in groups, on all pages).

Thank you in advance and best regards.

Last edited by grzjanik; 08-09-2011 at 13:33.
Reply With Quote
Old 19-09-2011, 09:31
shelbym's Avatar
shelbym shelbym is offline
Senior Member
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,791
Blog Entries: 15
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 Pages, Groups, Powerclips

I am getting old, took me a few minutes to remember how to do this in version 12. :-) This should work.
Public Sub ConvertALLTextToCurves()
    Dim p As Page
    For Each p In ActiveDocument.Pages
        ConvertShapes p.Shapes
    Next p
End Sub

Private Sub ConvertShapes(ss As Shapes)
    Dim s As Shape
    For Each s In ss
        Select Case s.Type
            Case cdrTextShape
                ConvertShapeCurves s
            Case cdrGroupShape
                ConvertShapes s.Shapes
        End Select
        On Error Resume Next
        If Not s.PowerClip Is Nothing Then
            ConvertShapes s.PowerClip.Shapes
        End If
    Next s
End Sub

Private Sub ConvertShapeCurves(s As Shape)
    Dim strName As String
    strName = s.Text.FontProperties.Name & " (size: " & s.Text.FontProperties.Size & " pt)"
    s.Name = strName
End Sub
Best of luck,

Reply With Quote
Old 19-09-2011, 09:53
grzjanik grzjanik is offline
Join Date: Mar 2010
Location: Lodz, Poland
Posts: 86
Send a message via Skype™ to grzjanik
Default Bingo!

Shelby, very big thank you for your time and willingness.
The code is work in entire document.
Your the best.
Reply With Quote

all document, convert, curves, font names

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
font change problem (otf-related?) marvin CorelDRAW/Corel DESIGNER VBA 4 20-10-2009 05:49
Change font Manuel CorelDRAW/Corel DESIGNER VBA 5 16-07-2009 03:40
Change Font Newbie Help FilmLadd Macros/Add-ons 2 23-11-2008 17:52
Convert font to curves Panjtan CorelDRAW/Corel DESIGNER VBA 2 15-10-2007 22:43
Select specified text, change font size? fiddler2b CorelDRAW/Corel DESIGNER VBA 3 23-04-2006 08:11

All times are GMT -5. The time now is 21:36.

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