How do I get the correct URL for an OfficeLive document from the COM API?

D

David Thielen

Hi;

I'm starting this question over because the previous exchange was a
bunch of different questions.

We have a program that will read an OfficeLive document if given the
public URL of the document in OfficeLive. Works great.

However, it does not work if given the filename returned by
Document.FullName. So what I need to know is either:

1) How can I get the public URL of the document being edited?

2) How can I read a file based on the URL that Document.FullName
returns?

Again, the question is not how do I read a file from OfficeLive - we
have solved that. The question is how do I read the file I am editing
with the issue being that Word & Excel do not return a URL that can be
read.

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,
We have a program that will read an OfficeLive document if given the
public URL of the document in OfficeLive. Works great.

What do you mean by "the public URL"? Could you give an example of such a
URL?
2) How can I read a file based on the URL that Document.FullName
returns?

Here you said "read", do you mean the raw data (byte by byte)?

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,


What do you mean by "the public URL"? Could you give an example of such a
URL?

at http://workspace.office.live.com/#davidwindward one of my documents
has the url
http://workspace.office.live.com/#davidwindward/Documents/DavidT -
simple test.xlsx - and this comes up if pasted in a browser

But Application.ActiveWorkbook.FullName returns
http://davidwindward.workspace.office.live.com/Docs/DavidT - simple
test.xlsx when this file is in Excel.

Similiar problem with Word & DOCX files.

Here you said "read", do you mean the raw data (byte by byte)?

Correct - we need to read and parse the file.

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,

Actually "http://davidwindward.workspace.office.live.com/Docs/DavidT -
simple test.xlsx" *IS* the *REAL* url of the document.

Let me explain more about what I found.

When you copy & paste this address:
http://workspace.office.live.com/#davidwindward/Documents/DavidT - simple
test.xlsx

into a browser, you got the file show up in the browser. Yes, that's right
- because you have your Windows Live ID already logged in. Now the server
got the request from the browser, it first checks the Live ID login, if
that's okay, it will parse the requested URL into the *REAL* path and
redirect the browser.

To prove this, what if you sign out of your Live ID from the browser and
clear all the stored browser cookies, then paste the URL into the browser
again and see if the file can be opened again?

But simply sending an HTTP request to the server with the *REAL* url still
won't work. The Office Live Add-in actually sends several requests to the
Office Live server to login, get meta information about the document, and
finally request for the document itself.

Here is a portion of what the Office Live Add-in sent to the server
requesting for the "document2.docx" file in my workspace:

*** begin request header ***

HEAD /Docs/Document2.docx HTTP/1.1
User-Agent: Microsoft Office Existence Discovery
Host: jiewan.workspace.office.live.com
Content-Length: 0
Proxy-Connection: Keep-Alive
Pragma: no-cache
Cookie: <too long, omitted>

*** end request header***

Note in the first line, it actually requests "/Docs/Document2.docx", that
matches the value Word returns.

Also note the User-Agent is "Microsoft Office Existence Discovery", if you
make a request with a different value, you get a "501- Not Implemented."
HTTP error. This is what exactly we see if we paste the *REAL* url into the
browser and hit enter - because our browser's User-Agent value if different.

Documents on the Office Live server are not simply put there, they may not
be files on the server at all, they may be stored in database, and upon
correct requests to the server application, the file stream is then sent to
the client.

I think it is possible to do the same thing the Office Live Add-in does, to
get the file from the server, however, it is inappropriate for me to do the
reverse engineering like job and publish the result to the public. I hope
you can understand this.

All I can tell you is, I used a tool called Fiddler to analyze the HTTP
data flow between the Word and the Office Live server, and got a basic
understanding of how the Add-in works. You can get the free tool from its
official website (3rd party website, not owned or controlled by MSFT, use
at your own risk): http://www.fiddler2.com/fiddler2/.

Best 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.
 
D

David Thielen

Hi;

We have it working. However, we are making some assumptions about the
name change. Can you please take a look at
http://blogs.windwardreports.com/ad...live-workspace-documents-in-office-addin.html
and tell me if what we are doing is correct and we can depend on this
always working?

thanks - dave

ps - some additional info on this is at
http://blogs.windwardreports.com/ad...-with-source-upload-download-with-webdav.html


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,

It's amazing you guys get it work without any official document! Good to
know it's working.

Regarding the "depend on this always working" question, I can't promise
that - since there is no official API & document from Microsoft to support
what you're doing, current implementation could change without notice in
the future. I noticed you're currently using WebDAV getting things done,
but even this might be removed in a future version of Live Workspace - as
long as the end user experience don't change.

I think there is not much I can do for you on the technical side of the
problem right now - the 3rd party development against Office Live Workspace
is not supported at this time.

However, I do understand what you want and how frustrated your engineers
are trying to get things work with OLW. I will tell my manager about your
requirements and concerns. We will try figure out what can be done for you
can let you know ASAP.

Best 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.
 
D

David Thielen

Hi David,

It's amazing you guys get it work without any official document! Good to
know it's working.

Regarding the "depend on this always working" question, I can't promise
that - since there is no official API & document from Microsoft to support
what you're doing, current implementation could change without notice in
the future. I noticed you're currently using WebDAV getting things done,
but even this might be removed in a future version of Live Workspace - as
long as the end user experience don't change.

I think there is not much I can do for you on the technical side of the
problem right now - the 3rd party development against Office Live Workspace
is not supported at this time.

However, I do understand what you want and how frustrated your engineers
are trying to get things work with OLW. I will tell my manager about your
requirements and concerns. We will try figure out what can be done for you
can let you know ASAP.

Thank you. Any info you can get will be a big help. And the previous
posts from you helped a lot too.

thanks - dave

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

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

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