Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

OLE object - bitmap representation?

185 views
Skip to first unread message

David Thielen

unread,
Sep 3, 2005, 8:21:02 AM9/3/05
to
Hi;

When there is an OLE object in a Word file (rtf or xml), does that object
include a bitmap picture of the OLE object to display if the program that
understands the ole object is not on someone's computer?

And if so, is how to get that image documented? And if so, where?

--
thanks - dave

Rhett Gong [MSFT]

unread,
Sep 5, 2005, 3:07:27 AM9/5/05
to
Hello Dave,

>does that object include a bitmap picture of the OLE object to display if the program that
>understands the ole object is not on someone's computer?

Yes. take rtf file for example, the bmp object is included along with file, since you can find the object from rtf's source (see below).

>And if so, is how to get that image documented? And if so, where?

In rtf file, the bmp object is embedded after following line:
{\object\objemb{\*\objclass Package}\objw2115\objh765{\*\objdata

For more details on how rtf stores ole objects, please reference following document, especially Objects section:
[Rich Text Format (RTF) Specification, version 1.6]
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnrtfspec/html/rtfspec.asp


Thanks,
Rhett Gong [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp&SD=msdn

This posting is provided "AS IS" with no warranties and confers no rights.

Alexander Nickolov

unread,
Sep 6, 2005, 1:58:53 PM9/6/05
to
Not necessarily a bitmap. A metafaile is more appropriate,
but then again that depends on the object itself. Read more
about FORMATETC, TYMED, and STGMEDIUM, as well as
IDataObject.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnic...@mvps.org
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================

"David Thielen" <thi...@nospam.nospam> wrote in message
news:74D9C5BE-AD5A-4D8C...@microsoft.com...

David Thielen

unread,
Sep 7, 2005, 10:28:07 AM9/7/05
to
Are you saying the objdata might be a metafile instead of a bitmap? If so,
how do I tell what it is?

--
thanks - dave

Alexander Nickolov

unread,
Sep 7, 2005, 1:11:50 PM9/7/05
to
I really suggest you read all this in "Inside OLE" by Kraig
Brockschmidt. The container uses IDataObject to get
the object's representation. A typical object uses the
standard in-proc handler, which means there is an OLE
cache underneath populated with the data from the real
object so it doesn't need to be instantiated for each
IDataObject request (see IOleCache and the default
in-proc handler). In short, you don't know the format
until you load the object (OleLoad) and ask it (via
IDataObject) to get its representation. Since most OLE
objects use in-proc handlers, the object's executable
server won't be launched.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnic...@mvps.org
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================

"David Thielen" <thi...@nospam.nospam> wrote in message

news:5D7FAC55-6ECC-46D5...@microsoft.com...

David Thielen

unread,
Sep 7, 2005, 1:25:03 PM9/7/05
to
Hi;

Ok, but I am getting this object as a uuencoded string inside a Word rtf
file. And I need to use this from java (not Windows/C#). I was hoping that
there was a plain old bitmap in there somewhere which I could extract.

Is there a way to do this or is the objdata uuencode an OLE format that
needs to be passed to a Windows OLE API?

Alexander Nickolov

unread,
Sep 7, 2005, 1:36:40 PM9/7/05
to
Unfortunately, I can't help you with the RTF format...

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnic...@mvps.org
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================

"David Thielen" <thi...@nospam.nospam> wrote in message

news:A07AF30F-E6A9-4003...@microsoft.com...

David Thielen

unread,
Sep 12, 2005, 6:16:03 PM9/12/05
to
Hello;

The rtf spec says that the binary data under objdata is the OLE data, not a
bitmap.

I tried saving to a WordML (xml) file also as that tends to be cleaner. It
had a large bindata named oledata.mso (I assume the OLE data) and a smaller
one named wordml://08000001.wmz. Any idea what format that is? It is not
bmp/png/jpg

--
thanks - dave

Rhett Gong [MSFT]

unread,
Sep 13, 2005, 1:48:57 AM9/13/05
to
Hi Dave,

|>The rtf spec says that the binary data under objdata is the OLE data, not a
|>bitmap.

Yes, if you open a RTF file in notepad, you may find the bmp is presented as:
{\object\objemb{\*\objclass Paint.Picture}\objw1650\objh1950{\*\objdata
From the string, it is a embedded Paint.Picture object with 1650*1950 in twips.

|>I tried saving to a WordML (xml) file also as that tends to be cleaner. It
|>had a large bindata named oledata.mso (I assume the OLE data) and a smaller
|>one named wordml://08000001.wmz. Any idea what format that is? It is not
|>bmp/png/jpg

We can find following lines from .xml files saved from a rtf by Word:
<w:docOleData><w:binData w:name="oledata.mso">
....................
</w:binData></w:docOleData><w:docPr>
oledata.mso is a base64 encoded storage for ole objects. you may use IXMLDOMDocument/DOMDocument::selectSingleNode to load the docOleData node. I have
searched intranet but there are not any docs for resolving the mso object. If you need details on mso object, I suggest you contact Microsoft PSS for an intensive assistant.

In addition: for the schema about wordml, you can download the office schema Reference from:
http://www.microsoft.com/downloads/details.aspx?FamilyId=FE118952-3547-420A-A412-00A2662442D9&displaylang=en

David Thielen

unread,
Sep 13, 2005, 9:40:04 AM9/13/05
to
Hello;

I am parsing the word documents in java so I can't use the OLE API such as
IXMLDOMDocument. I have to write my own code.

Looking at WordML:

I agree that the oledata.mso is the OLE object - it's for the Equation
editor in the example I am playing with. And I think that is of no use to me.

But the 08000001.wmz I think is some kind of general picture of the output -
for when the program that created the OLE object is not on the system viewing
the document. I read the WordML docs but all it says about bindata is it is a
binary representation of the data - no info on the format.

So my questions is: What formats can binData hold? And what is the .wmz
format?

Looking at rtf:

It clearly has a \wmetafile as the result to draw the picture. But no where
does it explain the metafile format.

So my question is, where can I find the metafile format? And is there a
metafile viewer anywhere?

--
thanks - dave


"Rhett Gong [MSFT]" wrote:

> Hi Dave,
> |>The rtf spec says that the binary data under objdata is the OLE data, not a
> |>bitmap.
>
> Yes, if you open a RTF file in notepad, you may find the bmp is presented as:
> {\object\objemb{\*\objclass Paint.Picture}\objw1650\objh1950{\*\objdata
> From the string, it is a embedded Paint.Picture object with 1650*1950 in twips.
>
> |>I tried saving to a WordML (xml) file also as that tends to be cleaner. It
> |>had a large bindata named oledata.mso (I assume the OLE data) and a smaller
> |>one named wordml://08000001.wmz. Any idea what format that is? It is not
> |>bmp/png/jpg
>
> We can find following lines from .xml files saved from a rtf by Word:
> <w:docOleData><w:binData w:name="oledata.mso">

> .....................

Rhett Gong [MSFT]

unread,
Sep 14, 2005, 10:32:52 PM9/14/05
to
>So my questions is: What formats can binData hold? And what is the .wmz
|>format?
|>
|>So my question is, where can I find the metafile format? And is there a
|>metafile viewer anywhere?

Unfortunately, these formats are not documented anywhere. From your post, your need this information in your product to analyze the embedded binary data, so I suggest
you open an support incident to Microsoft PSS to discuss avaliable support options for you.

For your convenience, I attached steps to contact Microsoft PSS here:
dial 1-(800)936-5800 or by choosing one of the options listed at http://www.microsoft.com/services/microsoftservices/srv_support.mspx


Thanks for your understanding,

David Thielen

unread,
Sep 14, 2005, 11:09:06 PM9/14/05
to
Hi;

I tried that once before - the rtf & WordML formats are not supported by PSS
either.

thanks - dave


--
thanks - dave

Rhett Gong [MSFT]

unread,
Sep 15, 2005, 3:42:00 AM9/15/05
to
If PSS does not support it, it can't be supported from newsgroup either.

But I will leave this post open in case if community member could shed some light. If there is any information from community, I will send a notification to you. Thanks for
your understanding.

Good luck,

Alexander Nickolov

unread,
Sep 15, 2005, 1:15:47 PM9/15/05
to
Metafile is not a closed format, so it should be supportable by
Microsoft! I haven't dealt with it specifically, but there are
third party applications (Corel Draw comes to mind) that
can import and export metafiles (original and enhanced).

Basically, a metafile is a series of GDI commands. It's created
by issuing GDI commands on a metafile DC. It can be played
by creating a DC off the metafile and then using BitBlt and/or
StretchBlt on an off-screen DC to get a bitmap representation.
Obviously none of this helps you much as a Java developer,
unless you step out of Java using JNI...

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnic...@mvps.org
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================

"Rhett Gong [MSFT]" <v-ra...@online.microsoft.com> wrote in message
news:rMgbFkc...@TK2MSFTNGXA01.phx.gbl...

David Thielen

unread,
Sep 15, 2005, 2:31:13 PM9/15/05
to
The problem is it is not a wmf or emf file image. So while it may contain a
metafile, it's not clear how to get the metafile out of it.

But as you said, they should support it...

--
thanks - dave

0 new messages