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 04-05-2004, 05:46
Bellekom
Guest
 
Posts: n/a
Default Reset text after text compression.

Can you help me please with my problem.

I'm using Corel designer 10 incl Sp1 & Sp2.
My question is:

When I select a paragraph text and compress the text, by dragging the right-bottom-corner (not the grip, but the (lookes like) two lines and the arrow), then the frame incl the text will compress.
Is there a way to get the text exactly normal again ?

I don't understand why the program does this.
If I type all the text in one time and put enters in it, then every line react differently when I want to decompress the text.

I work with VBA, Is there a way to reset the text with a program ?
Or is there a way to show where the problem lies ?

In fact is this a problem with the character and word spacing.
But when I look in "Edit text" everthing is looking good.

You see...... I don't understand it .... ;-(
Thanks in advance.
Reply With Quote
  #2  
Old 04-05-2004, 10:33
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default Re: Reset text after text compression.

Fred, if you compress a paragraph text box by dragging the horizontal "arrow" handle in the lower right corner of the box, you change the character spacing, word spacing and range kerning parameters.

To restore your text look, you need to select all the text and go to the Format Text dialog.

Then on Character tab, set Range Kerning to 0%.

Go to Paragraph tab and in Spacing group set Character to 0% and Word to 100%.

This should help.

Or you can use the following macro:

Code:
Sub ResetCharSpacing()
    Dim tr As TextRange
    
    If ActiveShape Is Nothing Then
        MsgBox "Nothing selected", vbCritical
        Exit Sub
    End If
    
    If ActiveShape.Type <> cdrTextShape Then
        MsgBox "Make sure the a object is selected", vbCritical
        Exit Sub
    End If
    
    If ActiveShape.Text.IsEditing Then
        Set tr = ActiveShape.Text.Selection
        MsgBox "Unable to reset Range Kerning for selection", vbExclamation
    Else
        Set tr = ActiveShape.Text.Story
        ActiveShape.Text.FontProperties.RangeKerning = 0
    End If
    
    tr.WordSpacing = 100
    tr.CharSpacing = 0
End Sub
I just discovered that Range Kerning is not available on TextRange object in VBA for some reason, so it is not possible to reset kerning on text selection. However it is still possible to do this for the whole text object (just select it with the Pick tool, rather than Text tool)...
Reply With Quote
  #3  
Old 05-05-2004, 07:14
Bellekom
Guest
 
Posts: n/a
Default Sorry, but it doesn't work.

Dear Alex,

Thanks for your reply. The normal setting i've done earlyer and also this one didn't work. As a work-a-round I've made the folloing program, But still I want to know how to resolve the problem itself.

Sub Tekst_standaard()
'Programma gemaakt 03-05-2004, door Fred Bellekom
'************************************************
' Plaatst een nieuwe Paragraph text, volgens de geldende specs in Options.
' en verwijderd de oude text. Dit is nuttig als de tekst lastige dingen bevat.
'Als men artistic text omzet, zal de tekst iets naar onder verschuiven. (ong 0,7mm, de marge van het frame)
'************************************************
Dim Tekst As Shape: Dim Inhoud As String
Dim Hoogte As Double: Dim Breedte As Double
Dim Xas As Double: Dim Yas As Double

For Each Tekst In ActiveSelection.Shapes 'ActiveSelection.Shapes ' *********===== *****
If Tekst.Type = cdrTextShape Then

'If tekst.text.Type = cdrParagraphText Then 'indien nodig .........
On Error GoTo Volgende
Inhoud = Tekst.Text.Story
Tekst.GetPosition Xas, Yas
Tekst.GetSize Breedte, Hoogte
ActivePage.ActiveLayer.Name = Tekst.Layer.Name
If Tekst.Text.Type = cdrArtisticText Then
Yas = Yas + (0.675 / 25.4)
Breedte = Breedte * 1.1: Hoogte = Hoogte * 1.1
End If

ActiveLayer.CreateParagraphText Xas, Yas, Xas + Breedte, Yas - Hoogte, Inhoud
Tekst.Delete
Volgende:
'end if
End If
Next Tekst
ActiveDocument.ClearSelection
End Sub

You can test your salution yourself (see attchment) en see that it doesn't work. Is there an other way (a neate one) to resolve it without replacing the text ?

Thanks in advance,

p.s. Why can't I attach DES-extension ?
Attached Files
File Type: cdr Text_test.cdr (12.9 KB, 801 views)
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
Text ENCODE Craig Tucker CorelDRAW/Corel DESIGNER VBA 10 26-01-2005 14:59
format text dialog box implement graphicdesigner CorelDRAW/Corel DESIGNER VBA 5 22-12-2004 14:37
Getting the center X on a text shape Rick Randall CorelDRAW/Corel DESIGNER VBA 4 03-08-2004 19:27
Selection of Text off-page D_Green CorelDRAW/Corel DESIGNER VBA 2 04-10-2003 17:34
Placing a custom envelope on Text larrypanattoni CorelDRAW/Corel DESIGNER VBA 3 23-04-2003 10:18


All times are GMT -5. The time now is 22:12.


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