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 19-02-2003, 07:47
dueless
Guest
 
Posts: n/a
Default Attributes in Corel Draw

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
Reply With Quote
  #2  
Old 19-02-2003, 13:42
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default Re: Attributes in Corel Draw

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.
Reply With Quote
  #3  
Old 20-02-2003, 12:36
dueless
Guest
 
Posts: n/a
Default

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
Reply With Quote
  #4  
Old 21-02-2003, 08:20
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default Re: Attributes in Corel Draw

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.
Reply With Quote
  #5  
Old 21-02-2003, 09:38
dueless
Guest
 
Posts: n/a
Default

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
Reply With Quote
  #6  
Old 21-02-2003, 10:16
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default

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
Even though the above code will still work in CorelDRAW 11 as well, it is suggested to use the new text object implementation:

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
You might want to mark the text objects with special names to identify the objects whose contents must be extracted. For example, give each text object to be extracted a name "Field" and modify your code as follows:

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
In the above code, only text objects named "Field" will be processed.

I hope this helps.
Reply With Quote
  #7  
Old 09-01-2008, 05:09
Dave Rowland
Guest
 
Posts: n/a
Default

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.
Reply With Quote
  #8  
Old 09-01-2008, 06:46
VyperOne
Guest
 
Posts: n/a
Default

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...
Reply With Quote
  #9  
Old 09-01-2008, 06:56
Dave Rowland
Guest
 
Posts: n/a
Default

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.
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
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


All times are GMT -5. The time now is 04:15.


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