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-2011, 09:30
aakkaarr aakkaarr is offline
Senior Member
 
Join Date: Jan 2009
Posts: 163
Default Can Variable be assigned to CQL Query

Can Variable be assigned to CQL Query
dim w as double
set sr = activepage.findshapes(Query := @width = w)

if not suggest the correct way

The objective is to delete all the object that meet this 'Width'
Reply With Quote
  #2  
Old 04-05-2011, 10:07
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,790
Blog Entries: 13
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 and Variables

Sure you just need to break the string like this:
Code:
dim w as double
set sr = ActivePage.Shapes.FindShapes(Query:="@width = {" & w & "" & in & "}")
Best of luck,

-Shelby
Reply With Quote
  #3  
Old 04-05-2011, 14:26
aakkaarr aakkaarr is offline
Senior Member
 
Join Date: Jan 2009
Posts: 163
Default

Thanx for the quick reply but there is some thing wrong with syntax
as, when copy/pasted in macro it is not being accepted
Reply With Quote
  #4  
Old 04-05-2011, 16:52
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,790
Blog Entries: 13
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 and Variables

That is what I get for rushing. Here is a more complete version and a bit more flexible just in case you work in mm.
Code:
Sub SelectWithCQL()
    Dim w As Double
    Dim sr As ShapeRange
    Dim myUnit As String
    
    w = 1
    myUnit = "in" 'Set unit to inches could use mm for milimeters
    
    Set sr = ActivePage.Shapes.FindShapes(Query:="@width = {" & w & "" & myUnit & "}")
    sr.CreateSelection
End Sub
-Shelby
Reply With Quote
  #5  
Old 05-05-2011, 05:15
aakkaarr aakkaarr is offline
Senior Member
 
Join Date: Jan 2009
Posts: 163
Default

Thanx Shelby,
THis works perfectly.
One more thing I had your code from your earlier post to query color to "ToString", but that is not working in X5, can you suggest me code to select all object with same color.

regards
Reply With Quote
  #6  
Old 18-04-2012, 18:16
SteveDude SteveDude is offline
Senior Member
 
Join Date: Dec 2005
Location: Salina, Kansas USA
Posts: 149
Default ...

Read this for more info on CQL...

http://coreldraw.com/blogs/insider/p...documents.aspx
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
need a cql query for shapes not on a layer of certain name runflacruiser CorelDRAW/Corel DESIGNER VBA 2 15-02-2011 07:44
Where CorelDrawX3 stores shortcut keys assigned to VB macros? mpp_piotrp Macros/Add-ons 3 12-05-2008 08:49
Object variable or with block variable not set.. m31uk3 Code Critique 2 26-12-2007 14:17
Variable photos in template RonHill General 7 01-08-2005 13:17
Rudimentary query regarding ActiveX Addin sureshkumarp General 0 20-07-2005 11:59


All times are GMT -5. The time now is 23:52.


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