Is there a way to get the contents of the DOCX/XLSX/PPTX from the Office COM API?

D

David Thielen

Hi;

I just realized that if there is a way to get the contents of the
Office document, then we don't need access to OfficeLive. Is there a
way, even if it's Office 2007 only, to get the contents of the
document?

I know Word 2003 can give you the WordML of the document you are on -
but it is not exactly the same as when the file is saved to disk. And
Excel 2003 can give you the SpreadsheetML but that does not have a lot
of components - like images.

So, any way to get this?

thanks - dave

david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
C

Cindy M.

Hi David,
I just realized that if there is a way to get the contents of the
Office document, then we don't need access to OfficeLive. Is there a
way, even if it's Office 2007 only, to get the contents of the
document?

You mean while it's open in the app UI?

Doc.Content.WordOpenXML

Similar to the XML property, but returns the 2007 file info. I have no
idea how "complete" this is in comparison to the closed file. It would
certainly be a different structure, though, as it definitely returns a
string and not a "package".

I don't see anything comparable on the Excel side, but I may be
missing something.

That's as close as you're going to get, short of doing a "Save As" to
get a separate file. I believe there's an Excel command for that which
will save a copy as a separate file, not changing the currently opened
file path/name. Word doesn't have an equivalent, so it could get
rather complex (Save As, close, open the original file).

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
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 :)
 
S

SvenC

Hi David,
I just realized that if there is a way to get the contents of the
Office document, then we don't need access to OfficeLive. Is there a
way, even if it's Office 2007 only, to get the contents of the
document?

I know Word 2003 can give you the WordML of the document you are on -
but it is not exactly the same as when the file is saved to disk. And
Excel 2003 can give you the SpreadsheetML but that does not have a lot
of components - like images.

Just play a bit with intellisense in the VBA editor of the Office
apps. Word e.g. has Document.Paragraphs, .Sentences, .Tables
and so on to access different content parts of a document.

But I have no idea how "reading" the content via COM is related
to OfficeLive? Do you think you can remote access documents
with COM from OfficeLive workspaces? Doubt that. You will have
to download the file in whatever format (doc, docx, ppt, pptx) is
on the web server to a local file and open it with a locally installed
Office app to access is with the COM api of the Office app.
 
J

Jie Wang [MSFT]

Hi David,

Sorry but I didn't get it... Is there any relation between getting the
content of an Office document and the Office Live?

Could you please explain the real world scenario so I can better understand
the requirements?

Thanks,

Jie Wang

Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business days is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
D

David Thielen

Hi David,

Sorry but I didn't get it... Is there any relation between getting the
content of an Office document and the Office Live?

Could you please explain the real world scenario so I can better understand
the requirements?

We face two needs to read a file from OfficeLive. One of those is we
need the file that Office presently has open. If instead Office can
directly give us that file, either in memory (which would be weird for
a zip file) or it can be saved to the temp directory without changing
what file is being edited - then we could use that rather than having
to read from OfficeLive.

Our other need to read from OfficeLive is for a data XML file but that
is not critical today. (It will be in about 3 weeks.)

thanks - dave

david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
J

Jie Wang [MSFT]

Hi David,

One more thing need to be clarified:

Are you using the free Office Live Workspace or the paid Office Live Small
Business?

For the Workspace, there is no public API available, so currently there is
no official way to read files from Office Live Workspace. I spent several
hours using an HTTP monitoring tool and together with the Windows Live ID
SDK trying to get the file from Office Live Workspace using my own C# code.
I was pretty close, but still not totally working.

You can also use similar methods to hack around, but there is no guarantee
the service won't change in the future so your code will stop working.

For the Office Live Small Business, there are complete document & code
samples on MSDN:
The Portal:
http://msdn.microsoft.com/en-us/office/aa905514.aspx

Code samples:
http://msdn.microsoft.com/en-us/library/bb802996.aspx

Developer Guide:
http://msdn.microsoft.com/en-us/library/bb803054.aspx

Hope this makes the Office Live API story clear.

Regards,

Jie Wang

Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business days is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

Jie Wang [MSFT]

We want to work on both.

So currently only Office Live Small Business exposes public API and you can
find samples & docs in the link I provided in my previous post.

Regards,

Jie Wang

Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business days is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

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