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 16-07-2011, 01:15
gorgo gorgo is offline
Senior Member
 
Join Date: Feb 2010
Posts: 169
Default include groups - gathering text totals

How could I tell this macro to look into groups when gathering the total fonts which are Artistic then Paragraph?

Code:
    Dim srArtistic As ShapeRange
    Dim srParagraph As ShapeRange
    Dim s As Shape
    
    Set srArtistic = ActivePage.Shapes.FindShapes(Query:="@Com.Text.Type = 0")
    Set srParagraph = ActivePage.Shapes.FindShapes(Query:="@Com.Text.Type = 1")
    
    MsgBox "Total Artistic Text Count" & vbCr & srArtistic.Count
    MsgBox "Total Paragraph Text Count" & vbCr & srParagraph.Count
Reply With Quote
  #2  
Old 17-07-2011, 15:19
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,770
Blog Entries: 10
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 CQL Text

By default CQL will already look into groups so you should not have to worry about this.

The problem with the code (Yes, which is mine so I am only criticizing myself.) is that if you use the '@com.Text.type' and there are other shape types on the page the macro will fail, so you should avoid using it. Instead you should use the following.
Code:
Sub FindText()
    Dim srArtistic As ShapeRange
    Dim srParagraph As ShapeRange
    
    Set srArtistic = ActivePage.Shapes.FindShapes(Query:="@type='text:artistic'")
    Set srParagraph = ActivePage.Shapes.FindShapes(Query:="@type='text:paragraph'")
    
    MsgBox "Total Artistic Text Count" & vbCr & srArtistic.Count
    MsgBox "Total Paragraph Text Count" & vbCr & srParagraph.Count
End Sub
Hopefully that helps,

-Shelby
Reply With Quote
  #3  
Old 17-07-2011, 15:43
gorgo gorgo is offline
Senior Member
 
Join Date: Feb 2010
Posts: 169
Default

cool beans. yep, I forgot to mention that grouped text will cause a problem using the 1,0 things in your older code. Thanks for the help Shelby!
Reply With Quote
  #4  
Old 27-07-2011, 09:04
bryan23
Guest
 
Posts: n/a
Default Please i want to add a tool bar for add accent mark

Please i want to add a tool bar for add accent code eg: a with accent mark on top on any other of my choose
Reply With Quote
  #5  
Old 27-07-2011, 09:10
runflacruiser's Avatar
runflacruiser runflacruiser is offline
Senior Member
 
Join Date: Jun 2009
Location: Pigeon Forge, TN USA
Posts: 811
Default

Quote:
Originally Posted by shelbym View Post

The problem with the code (Yes, which is mine so I am only criticizing myself.) is that if you use the '@com.Text.type' and there are other shape types on the page the macro will fail, so you should avoid using it. [/code]

Hopefully that helps,

-Shelby
HI.
One Cool thing I noticed is that the query is read linearly from left to right and any items that don't pass the first validation won't make it to the second. So if you put text.type after a proper validation it will pass.

Just something I noticed that was interesting...

~John
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
include groups - reverting symbols to objects gorgo CorelDRAW/Corel DESIGNER VBA 1 25-03-2011 13:16
Artistic Media Groups And VBA knowbodynow CorelDRAW/Corel DESIGNER VBA 2 08-05-2008 22:18
How Can I reference groups of objects? knowbodynow CorelDRAW/Corel DESIGNER VBA 4 25-01-2007 17:18
Multiple Groups & Align Under kuty CorelDRAW/Corel DESIGNER VBA 2 17-08-2004 13:21
Include files Steve CorelDRAW/Corel DESIGNER VBA 2 29-09-2003 20:43


All times are GMT -5. The time now is 08:51.


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