Custom Properties for None WORD documents

G

Guest

Hi

For my application I have created a new document extension called .HST.
This extension is assocaited with WORD. For normal word and TXt documents I
am adding Custom Properties automatically using CustomDocumentProperties.Add

This works fine. However as part of my application I store all sorts of
documents types as .HST files. These include .MSG's and JPEG's etc. To these
I cannot add Custom Properties. I open the .HST files using somthing like
xDoc = xApp:Documents:Open ( P-FILE-NAME ) anf then add the properties. I
know this works because I can message them out immeadiately. However when I
try to SAVE the document using xApp:Documents:Save() I get errors because
the contents of the .HST file are effectively .MSG or .JPEG etc and WORD
wants to convert them. If i was to open the document in WORD manually and
press save I would get the same problem.

If I right click on the .HST I can add CUSTOM Properties manually so why can
I not do it automatically.

Is there an API I need to call to add custom propeties rather than opening
them as a WORD object. Or is there a way I can save the documents without
getting the errors.
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?TmljayBDaGlsZA==?=,

There are internal properties (Office custom properties), and then there are
properties available through the Windows environment. That's most likely what
you're seeing when you right-click a file. The Office properties are designed to
be accessible in this manner, as well. MS supplies a tool named DSOFile(.exe)
that VB programmers can use to read and write these properties for Office files.

I believe DSOFile is a wrapper for something in the API, but I couldn't tell you
what. If your programming language is VB, then I'd start in a classic VB
newsgroup. If it's C++, then head to a group for that, and maybe search MSDN.
For my application I have created a new document extension called .HST.
This extension is assocaited with WORD. For normal word and TXt documents I
am adding Custom Properties automatically using CustomDocumentProperties.Add

This works fine. However as part of my application I store all sorts of
documents types as .HST files. These include .MSG's and JPEG's etc. To these
I cannot add Custom Properties. I open the .HST files using somthing like
xDoc = xApp:Documents:Open ( P-FILE-NAME ) anf then add the properties. I
know this works because I can message them out immeadiately. However when I
try to SAVE the document using xApp:Documents:Save() I get errors because
the contents of the .HST file are effectively .MSG or .JPEG etc and WORD
wants to convert them. If i was to open the document in WORD manually and
press save I would get the same problem.

If I right click on the .HST I can add CUSTOM Properties manually so why can
I not do it automatically.

Is there an API I need to call to add custom propeties rather than opening
them as a WORD object. Or is there a way I can save the documents without
getting the errors.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top