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 15-11-2013, 00:37
ager ager is offline
Member
 
Join Date: Jul 2010
Location: Russia
Posts: 44
Default MetaData

How to write and read information (for example in *.txt format) from *.cdr\metadata folder without unpacking cdr-file? It would be easy if this code works:
Code:
...
iFilePath="....\anyfile.cdr\metadata\xxx.txt"
Open iFilePath For Input As #1
....
But Run-time error "76" appears.

Last edited by ager; 15-11-2013 at 00:40.
Reply With Quote
  #2  
Old 15-11-2013, 02:21
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,778
Blog Entries: 11
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 MetaData

If you open the document you can do something like this:
Code:
Sub TestMetaData()
    ActiveDocument.Metadata.Title = "My Title"
    MsgBox ActiveDocument.Metadata.Title
End Sub
If not, you are going to have to extract the file, then parse it.

-Shelby
Reply With Quote
  #3  
Old 15-11-2013, 03:29
ager ager is offline
Member
 
Join Date: Jul 2010
Location: Russia
Posts: 44
Default MetaData

OK, thank you very much, Shelbym!
I just want to embed a large data-text file in cdr-file. And I'm afraid that this method not quite what me need.
Reply With Quote
  #4  
Old 15-11-2013, 07:13
ddonnahoe's Avatar
ddonnahoe ddonnahoe is offline
Senior Member
 
Join Date: Jan 2004
Location: Louisville, KY
Posts: 552
Send a message via ICQ to ddonnahoe Send a message via AIM to ddonnahoe Send a message via MSN to ddonnahoe Send a message via Yahoo to ddonnahoe
Default

Ager, what exactly are you embedding in the file. This sounds like somthing similar to what I'm doing, but I don't understand your specific purpose.
__________________
Sean
Waiting for a ride in the T.A.R.D.I.S.
Reply With Quote
  #5  
Old 16-11-2013, 13:18
SteveDude SteveDude is offline
Senior Member
 
Join Date: Dec 2005
Location: Salina, Kansas USA
Posts: 149
Default ...

This is something I have been working on. Have it done except for the actual Corel automation part. If a locked file is opened in Corel, it just loads a Locked with CDR Encrypt message.

One advantage I am finding to embedding data in CDR's, it is also possible to compress them to sometimes up to half their original size and they still work.

It is also possible to lock/unlock older CDR's -pre X4 and still have a preview, but when you attempt to open them you get a corrupted file message. Just toggling a couple of bits in the file.
Attached Images
 
Reply With Quote
  #6  
Old 17-11-2013, 20:09
ager ager is offline
Member
 
Join Date: Jul 2010
Location: Russia
Posts: 44
Default MetaData

Ddonnahoe, may be I don't exactly explain my idea. The specific purpose is drawing chart with my macro. The data of this chart are in txt-file, which consist of two columns (x-data and y-data). With my macro I can change the range of this chart and I want that it reads data from embedded txt-datafile (which located in MetaData folder within cdr-file), not from external txt-file. Thus, the data of the chart are permanently stored in cdr-file. I hope you understand me

Last edited by ager; 17-11-2013 at 23:49.
Reply With Quote
  #7  
Old 19-11-2013, 13:03
SteveDude SteveDude is offline
Senior Member
 
Join Date: Dec 2005
Location: Salina, Kansas USA
Posts: 149
Default Metadata

Ager, not sure if this will work for you or not, but have tried attaching your data directly in, say maybe the CDR's comments field? It would be easily available via automation that way and also show in the CDR Properties dialog in Explorer. There are ways to read and write those properties in .NET without having to open the CDR. It can also be done in VBA, but requires an external library.

Here's some info on it... http://support.microsoft.com/kb/224351
Reply With Quote
  #8  
Old 20-11-2013, 02:16
ager ager is offline
Member
 
Join Date: Jul 2010
Location: Russia
Posts: 44
Default MetaData

SteveDude, the volume of data is too big for CDR's comments field. The TXT-file has about 1000 lines of x and y data. My macro works in CDR-file and draws a chart using data from the TXT-file. The question is how to directly embed this TXT-file in the cdr-file. This will allow working with one CDR-file.
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


All times are GMT -5. The time now is 09:32.


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