Adding Custom File Formats to Word / Excel

L

LarryN

Hi,

My company has an application that wraps documents in a bundle (a project
archive, like a zip file). I've been tasked to create an add-in that extracts
the document (or workbook), and presents it in the appropriate Office
application.

I'd like to do this most seamlessly for the users by creating and installing
a new 'File Type' - when the user opens the bundle, the document or
spreadsheet is extracted and displayed in the host applicaiton. I've not been
able to find any documentation or samples that might be useful on creating
custom File Filters/Converters.

I would apprecaite any pointers as our security business rules do not allow
the document to be saved to the disk as an intermediate step and I would like
to avoid burdening the user.

Also, in the future there might be multiple documents in the bundle
(currently there is only one spreadsheet, one document, some other collateral
files), so if you have pointers on a way to push a whole document, text,
formatting, styles, etc. into the Office application, that would be awesome.

Thanks,

Larry
 
P

Patrick Schmid [MVP]

There is not really a way to add a file format to Word/Excel. For Word,
you can add an import filter that can send an RTF file to Word, but I
don't think this will be helpful in your case.
You probably have to replace the Open dialogs with your own one that
includes your file types.

Patrick Schmid [OneNote MVP]
--------------
http://pschmid.net
***
Outlook 2007 Performance Update: http://pschmid.net/blog/2007/04/13/105
Office 2007 RTM Issues: http://pschmid.net/blog/2006/11/13/80
***
Customize Office 2007: http://pschmid.net/office2007/customize
RibbonCustomizer Add-In: http://pschmid.net/office2007/ribboncustomizer
OneNote 2007: http://pschmid.net/office2007/onenote
***
Subscribe to my Office 2007 blog: http://pschmid.net/blog/feed
 
L

LarryN

Patrick,

Thanks for your initial reply. The inability to add custom types just makes
things harder. If I do as you suggest, how do I move my content into the
document?

I was thinking I could replace the document's Open and Save methods with my
own method, but when I tried to derive a class from the Word.document class,
it failed with a series of cascading error messages. Is there something
special I must do in order to derive a class from the document class?

Also, I cannot find any documentation on accessing the documents stream of
bytes in order to write or read into the document (including all the content,
styles, header, footer, etc).

I just cannot believe that it is that difficult to extend Word in this
fashion. Has anyone succeeded in storing a document to a database?

Thanks for your continued help,

Larry
 

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