![]() |
#1
|
|||
|
|||
![]()
can someone help me with this? i want the macro to get the text at the selected shape. this is obviously not working. thanks.
Sub getselectiontext() ActiveDocument.Pages(pagenum).ActiveLayer.Activate ActivePage.SelectShapesAtPoint(2.3, 9.88, True).CreateSelection Set shRange = ActiveSelectionRange MsgBox shRange.Shapes.Count For Each stext In shRange.FindShapes(Type:=cdrTextShape) Set tr = stext.Text.Story.Duplicate MsgBox tr Next stext ' If s.Type = cdrTextShape Then s.Text.Story = "New Text": Stop End Sub |
#2
|
||||
|
||||
![]()
Give this a try:
Code:
Sub getselectiontext() Dim tr As New ShapeRange, sText As Shape, sel As Shape ActiveDocument.ShapeEnumDirection = cdrShapeEnumBottomFirst Set sel = ActivePage.SelectShapesAtPoint(2.3, 9.88, True) For Each sText In sel.Shapes.FindShapes(Type:=cdrTextShape) tr.Add sText.Duplicate Next sText End Sub -Shelby |
#3
|
|||
|
|||
![]() Quote:
|
#4
|
||||
|
||||
![]()
Because it is finding each text object then duplicating them. You could do it like this and avoid the loop altogether.
Code:
Sub getselectiontext() Dim tr As New ShapeRange, sText As Shape, sel As Shape ActiveDocument.ShapeEnumDirection = cdrShapeEnumBottomFirst Set sel = ActivePage.SelectShapesAtPoint(2.3, 9.88, True) sel.Shapes.FindShapes(Type:=cdrTextShape).Duplicate End Sub -Shelby |
#5
|
|||
|
|||
![]()
Shelby,
Thanks again! =D |
![]() |
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 |
get selection text help | misteralien | General | 0 | 11-02-2010 00:17 |
Bug with existing selection | m31uk3 | Code Critique | 1 | 02-01-2008 19:18 |
Text selection and sizing | ddonnahoe | CorelDRAW/Corel DESIGNER VBA | 5 | 17-05-2005 14:19 |
Text selection problem | ken_ac | CorelDRAW/Corel DESIGNER VBA | 2 | 10-02-2004 21:24 |
Selection of Text off-page | D_Green | CorelDRAW/Corel DESIGNER VBA | 2 | 04-10-2003 17:34 |