![]() |
#1
|
|||
|
|||
![]()
Hello,
I'm new to visual basic for Corel Draw 10 and was wondering a few things. Can I extract information out of titleblocks I set up in Corel Draw such as project, customer, designer, drawing number etc... ? I'm an Autocad user and the term we use for these things is attributes. Does such a "creature" exist in Corel Draw? If so what objects, methods, etc. do I need to call out to accomplish such a task. This is a wonderful site and I shall visit quite often! Thanks in advance, Dueless |
#2
|
||||
|
||||
![]()
Dueless,
It depends on where the information is stored and how you set it up. I guess you'll need to provide more information about what you are doing. Do you import some AutoCAD files and trying to extract the attributes from objects imported? Or do you create the documents in CorelDRAW and want to store some additional information in the drawing? Or do you need something else? Please provide more information. |
#3
|
|||
|
|||
![]()
The information would be created in CorelDRAW. I simply want to
extract certain data from the titleblock. AutoCAD would not be involved (i.e. no importing. I was just using it as a base reference for explaining what I would like to do. For instance I would want to extract a salesperson's name or the designers name from a titleblock(in CorelDRAW) and write these values to a database. Hope this helps. Thanks, dueless |
#4
|
||||
|
||||
![]()
I'm sorry, but I still don't quite understand. What is a titleblock? Is it a text object? Where is the salesperson's name stored? Can you explain how you do it in CorelDRAW (step by step, if possible)?
Thanks. |
#5
|
|||
|
|||
![]()
Put it this way if I type (text) a salesperson's name in a CorelDRAW file
Can I then extract this text data and write it to a database? Basically can I extract text or words out of a CorelDRAW file. Thanks, dueless |
#6
|
||||
|
||||
![]()
Ok, so your drawing will contain several text objects and you want to extract their text content and put in the database. It's an easy task, however how would you know that a particular text object contains the name of a sales person, not something else? Or will you have only one text object per drawing?
Anyway, here is how to locate all the text objects in CorelDRAW 10 and extract their text and write it to a text file: Code:
Sub ExtractAndSave() Dim s As Shape Open "C:\TextExtract.txt" For Output As #1 For Each s In ActivePage.FindShapes(Type:=cdrTextShape) Print #1, s.Text.Contents Next s Close #1 End Sub Code:
Sub ExtractAndSave() Dim s As Shape Open "C:\TextExtract.txt" For Output As #1 For Each s In ActivePage.FindShapes(Type:=cdrTextShape) Print #1, s.Text.Story.Text Next s Close #1 End Sub Code:
Sub ExtractAndSave() Dim s As Shape Open "C:\TextExtract.txt" For Output As #1 For Each s In ActivePage.FindShapes(Name:="Field", Type:=cdrTextShape) Print #1, s.Text.Contents Next s Close #1 End Sub I hope this helps. |
#7
|
|||
|
|||
![]()
sorry for digging this up, but is similar to what i seek..
I am interested in storing a 'job number' as some other information that i can cross reference with. Is there a place like a file information area, in say the 'activedocument' where i can store variable information? the problem with storing data into text objects is they are prone to deleting, duplicating them or alike which would be tricky to program and capturre data. |
#8
|
|||
|
|||
![]()
When saving your file use the keywords field in the save dialog to put your job number. Then using VBA query the activedocument.keywords property to ascertain the job number...
|
#9
|
|||
|
|||
![]()
yeah thanks for that.. forgot about them there and Notes is there too. I just done a test and seems read/write so no problems.
|
![]() |
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 |
Corel Draw 10 - adjusting DUPLICATE placing | Anonymous | General | 4 | 27-06-2007 12:19 |
Corel Draw 13 | Anonymous | General | 3 | 06-09-2005 10:34 |
Problem with opened dialog box Corel Draw 11 | dergy | CorelDRAW/Corel DESIGNER VBA | 1 | 14-06-2004 10:04 |
Kerning of Corel Draw fonts | knight74 | CorelDRAW/Corel DESIGNER VBA | 1 | 30-01-2004 14:34 |
Tables in Corel Draw 10 | betob | New product ideas | 0 | 04-09-2003 04:46 |