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 14-11-2007, 02:04
masterchiefph
Guest
 
Posts: n/a
Default duplicate text?

hi all

i have a macro that import text and save to layer, i would like to delete the duplicate text inside the layer. can you give me some sample script for this?..

Many thanks

Last edited by masterchiefph; 14-11-2007 at 03:28.
Reply With Quote
  #2  
Old 14-11-2007, 07:07
wOxxOm's Avatar
wOxxOm wOxxOm is offline
Senior Member
 
Join Date: Mar 2005
Posts: 836
Default

depends on how the text is organized after import. How about a sample cdr file?
Reply With Quote
  #3  
Old 14-11-2007, 18:57
masterchiefph
Guest
 
Posts: n/a
Default

the text is just an artistic in a layer, i want to use collection object or any script that would delete duplicate text. would you mind to give me sample vb script for this?

Thanks
Reply With Quote
  #4  
Old 14-11-2007, 20:56
masterchiefph
Guest
 
Posts: n/a
Default

can't find deleting duplicate text inside a layer in this forum.. need your help i am stuck hehehe..

Last edited by masterchiefph; 19-11-2007 at 21:00.
Reply With Quote
  #5  
Old 14-11-2007, 20:57
wOxxOm's Avatar
wOxxOm wOxxOm is offline
Senior Member
 
Join Date: Mar 2005
Posts: 836
Default

I have no such script/macro.
But it could be easily done if you provide an example, better CDR file with a text before macro and manual rendition of what should be after.
Reply With Quote
  #6  
Old 15-11-2007, 19:02
masterchiefph
Guest
 
Posts: n/a
Default

Hi woxxom cant post the script because im using a remote pc. the text is from .cdw to .crd. below is the script that i found in this forum delete duplicate shape and im thingking if there's a away to delete duplicate artistic text in active page? same logic below script..

Quote:
Originally Posted by wOxxOm View Post
Sub DeleteDuplicate12()
Dim sr As ShapeRange
Dim srDup As New ShapeRange
Dim i As Long, j As Long
Dim s1 As Shape, s2 As Shape
Dim x1 As Double, y1 As Double
Dim x2 As Double, y2 As Double
Dim cmp As cdrCompareType

cmp = cdrCompareFill + cdrCompareOutline + cdrCompareShapeType + _
cdrCompareShapeWidth + cdrCompareShapeHeight

Set sr = ActiveLayer.Shapes.All

For i = 1 To sr.Count - 1
Set s1 = sr(i)
s1.GetPosition x1, y1
For j = i + 1 To sr.Count
Set s2 = sr(j)
s2.GetPosition x2, y2
If s1.CompareTo(s2, cmp) And x1 = x2 And y1 = y2 Then
srDup.Add s2
End If
Next j
Next i

srDup.Delete
End Sub
Reply With Quote
  #7  
Old 15-11-2007, 19:10
wOxxOm's Avatar
wOxxOm wOxxOm is offline
Senior Member
 
Join Date: Mar 2005
Posts: 836
Default

maybe.
Code:
Sub DeleteTextDuplicate()
   dim s1$, sr as shaperange, srDup as shaperange, i&, j&
   on error resume next
   Set sr = ActivePage.FindShapes(,cdrTextShape)
   set srDup = new ShapeRange

   For i = 1 To sr.Count - 1
      s1 = sr(i).Text.Story.Text
      For j = i + 1 To sr.Count
         If strComp(s1, sr(j).Text.Story.Text, vbTextCompare)=0 then srDup.Add sr(j)
      Next j
   Next i

   srDup.Delete
End Sub

Last edited by wOxxOm; 15-11-2007 at 19:58.
Reply With Quote
  #8  
Old 15-11-2007, 19:33
masterchiefph
Guest
 
Posts: n/a
Default

got Object Required on // Set "s1 ="...

pls help..

Last edited by masterchiefph; 15-11-2007 at 19:56.
Reply With Quote
  #9  
Old 15-11-2007, 19:59
wOxxOm's Avatar
wOxxOm wOxxOm is offline
Senior Member
 
Join Date: Mar 2005
Posts: 836
Default

yeah sorry, I've fixed it in that post, was typing on the fly, without testing

Last edited by wOxxOm; 15-11-2007 at 20:03.
Reply With Quote
  #10  
Old 15-11-2007, 20:12
masterchiefph
Guest
 
Posts: n/a
Default

THANKS for the help woxxom!
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
Striping a word down to the first letter only knowbodynow CorelDRAW/Corel DESIGNER VBA 9 19-04-2007 15:14
Adding text via VBA knowbodynow CorelDRAW/Corel DESIGNER VBA 2 03-03-2006 09:15
Text selection and sizing ddonnahoe CorelDRAW/Corel DESIGNER VBA 5 17-05-2005 13:19
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


All times are GMT -5. The time now is 00:31.


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