![]() |
#1
|
|||
|
|||
![]()
My code:
Sub Szöveg_csere() ActiveDocument.Unit = cdrMillimeter ActiveDocument.ReferencePoint = cdrCenter Dim s As Shape, n As Long, sr As ShapeRange Dim x As Double, y As Double, w As Double, h As Double Set sr = ActiveSelection.Shapes.FindShapes(, cdrTextShape) For Each s In sr s.Text.Replace "TEXT1", "TEXT2TEXT2", True, ReplaceAll:=True 'every selected text resize, but not only TEXT1 s.GetPosition x, y s.GetSize w, h s.SetSizeEx x, y, 111, h Next s End Sub Please Help! |
#2
|
||||
|
||||
![]()
Hi.
You're looking for shapes in the active selection. Are you sure you have something selected? If you want to process all shapes then use: Code:
Set sr = ActivePage.Shapes.FindShapes(, cdrTextShape) |
#3
|
|||
|
|||
![]()
Here is the text of all resize. I would like to have only exchanged text resize.
Attached test file. |
#4
|
||||
|
||||
![]()
Hi.
Try the get and set bounding box but you have to get the size first before you change it: Code:
Sub Szöveg_csere() ActiveDocument.Unit = cdrMillimeter ActiveDocument.ReferencePoint = cdrCenter Dim s As Shape, n As Long, sr As ShapeRange Dim x As Double, y As Double, w As Double, h As Double Set sr = ActivePage.Shapes.FindShapes(, cdrTextShape) For Each s In sr s.GetBoundingBox x, y, w, h s.Text.Replace "TEXT1", "TEXT2TEXT2", True, ReplaceAll:=True s.SetBoundingBox x, y, w, h Next s End Sub |
#5
|
|||
|
|||
![]()
This solution would be good if the same size as the original, but if I can resize the text then you have to implement all of the text. How to achieve it, only that the search / replace text, do the scaling?
|
#6
|
||||
|
||||
![]()
Hi.
I thing this is what you mean: Code:
Sub Szöveg_csere() ActiveDocument.Unit = cdrMillimeter ActiveDocument.ReferencePoint = cdrCenter Dim s As Shape, n As Long, sr As ShapeRange Dim x As Double, y As Double, w As Double, h As Double Set sr = ActivePage.Shapes.FindShapes(, cdrTextShape) For Each s In sr If s.Text.Story.Characters.All = "TEXT1" Then s.GetBoundingBox x, y, w, h s.Text.Replace "TEXT1", "TEXT2TEXT2", True, ReplaceAll:=True s.SetBoundingBox x, y, w, h End If Next s |
#7
|
|||
|
|||
![]()
It will be so good. The Bounding Boxes referencepoint how to change?
ActiveDocument.ReferencePoint = cdrCenter is NOT. s.SetBoundingBox x, y, 110, h,, cdrCenter is NOT. Center text aligment is s.SetBoundingBox x, y, 110, h,, cdrCenter bottomleft and I think the reference point. How to select reference point? |
#8
|
||||
|
||||
![]()
Hi.
I'm not 100% clear on what you mean but... You would have to calculate the center like x + w/2 -John |
#9
|
|||
|
|||
![]()
Thanks for your help!
![]() Now we have solved the problem with your help. I am very thankful for it! ![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Find/Replace Text in Multiple Open Documents | jfelder | Macros/Add-ons | 6 | 20-01-2009 12:20 |
Find all text and apply text style | keytecstaff | CorelDRAW/Corel DESIGNER VBA | 2 | 18-05-2006 09:48 |
Scale a group with text frame | daniello | Macros/Add-ons | 3 | 21-03-2006 14:54 |
Find and Replace Text with Form | RVogel | CorelDRAW/Corel DESIGNER VBA | 1 | 24-03-2005 09:37 |
Find/Replace with CorelDraw 9 and VB 6 | sfldan | CorelDRAW/Corel DESIGNER VBA | 1 | 10-07-2003 17:44 |