OberonPlace.com Forums

OberonPlace.com Forums (http://forum.oberonplace.com/index.php)
-   CorelDRAW/Corel DESIGNER VBA (http://forum.oberonplace.com/forumdisplay.php?f=16)
-   -   MetaData (http://forum.oberonplace.com/showthread.php?t=24643)

ager 15-11-2013 00:37

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:

Open iFilePath For Input As #1

But Run-time error "76" appears.

shelbym 15-11-2013 02:21

If you open the document you can do something like this:

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.


ager 15-11-2013 03:29

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.

ddonnahoe 15-11-2013 07:13

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.

SteveDude 16-11-2013 13:18

1 Attachment(s)
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.

ager 17-11-2013 20:09

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 :)

SteveDude 19-11-2013 13:03

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

ager 20-11-2013 02:16

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. :confused: This will allow working with one CDR-file.

All times are GMT -5. The time now is 07:37.

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