Calling all CorelDrawers!,
I am generating a series of objects in coreldraw15 that I am placing into a single layer. I am interested in extracting their X,Y coordinates as well as height values into spreadsheet (.xls) format. Any thoughts on how I might do this?
You can try macro below, it creates file c:\corelobjects.txt with information about object on active layer. Mark “|“ (alt+0124) is used as delimiter. Txt file can be easily imported to Excel.
sample txt file attached
Dim sh As Shape, w#, h#, x#, y#, s As Shape, n#
ActiveDocument.Unit = cdrMillimeter
Set s = ActiveDocument.ActiveLayer.CreateParagraphText(1, 1, 0, 0, "pos|x|y|h|w" & vbCr)
ActiveDocument.ReferencePoint = cdrCenter
For Each sh In ActivePage.Shapes
sh.GetPosition x, y
sh.GetSize w, h
i = sh.ZOrder
Set t = s.Text
t.Story.InsertAfter (i & "|" & x & "|" & y & "|" & w & "|" & h & "|" & vbCr)
n = ActivePage.Shapes.Count
t.ExportToFile "c:\corelobjects.txt", 1, n, cdrParagraphIndexing
© Corel Corporation. The content herein is in the form of a personal web log ("Blog") or forum posting. As such, the views expressed in this site are those of the participants and do not necessarily reflect the views of Corel Corporation, or its affiliates and their respective officers, directors, employees and agents. Terms and Conditions / User Guidelines.