More on trying to run on OfficeLive

D

David Thielen

We use the filename returned by the office app to read the file when
generating a report. Word, Excel, & PowerPoint all have variations on
this problem. Here is what occures with Excel:

1. In OfficeLive the file is
http://workspace.office.live.com/#davidwindward/Documents/DavidT -
simple test.xlsx
1. Requesting the file (1) above in a browser works!
2. Requesting the file (1) above returns an XLSX file
that appears to be some javascript.

2. Application.ActiveWorkbook.FullName returns
http://davidwindward.workspace.office.live.com/Docs/DavidT - simple
test.xlsx
1. Requesting the file (2) above returns an error 505 if
pasted in a browser.
2. Requesting the file (2) above in my C# code it returns
an error 501 (not implemented).

Note: we want to be able to read not just the Office files (which are
our report templates) but also XML files as data files.


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

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

SvenC

Hi David,
We use the filename returned by the office app to read the file

How does your reading code look like?
1. In OfficeLive the file is
http://workspace.office.live.com/#davidwindward/Documents/DavidT -
simple test.xlsx
1. Requesting the file (1) above in a browser works!
2. Requesting the file (1) above returns an XLSX file
that appears to be some javascript.

How is the request 2) executed? Show some code.

Maybe you have to encode the URL?
In your case space == %20
 
C

Colbert Zhou [MSFT]

Hi Dave,

I record a Marco and see the Word use the following url to open Office Live
document. And the following codes work fine in my side.

Word.Application app =
Marshal.GetActiveObject("Word.Application") as Word.Application;
object name =
@"http://colbertzhou.workspace.office.live.com/1a34ba32-cf51-4b33-81da-6527d
139843c/Docs/Essay Outline.doc";
object missing = Type.Missing;
app.Documents.Open(ref name, ref missing, ref missing, ref
missing,
ref missing, ref missing, ref missing, ref missing, ref
missing,
ref missing, ref missing, ref missing, ref missing, ref
missing,
ref missing, ref missing);


Best regards,
Colbert Zhou
Microsoft Newsgroup Support Team
 
D

David Thielen

Hi Dave,

I record a Marco and see the Word use the following url to open Office Live
document. And the following codes work fine in my side.

Word.Application app =
Marshal.GetActiveObject("Word.Application") as Word.Application;
object name =
@"http://colbertzhou.workspace.office.live.com/1a34ba32-cf51-4b33-81da-6527d
139843c/Docs/Essay Outline.doc";
object missing = Type.Missing;
app.Documents.Open(ref name, ref missing, ref missing, ref
missing,
ref missing, ref missing, ref missing, ref missing, ref
missing,
ref missing, ref missing, ref missing, ref missing, ref
missing,
ref missing, ref missing);

I try to readi t using the following:

WebRequest req = WebRequest.Create(filename);
WebResponse resp = req.GetResponse();
return resp.GetResponseStream();

I need the raw file so we can parse it.

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

Colbert Zhou [MSFT]

Hi Dave,

The first link should be the document in Office live's page. It is a html
file. So after we use WebRequest and WebResponse to download the html file
and store it as Office document, we will see javascript error in the file.

The second link seems only understood by the Office Live AddIn. As a
result, the Office application can retrieve and open it, but the IE and
WebRequest/WebResponse cannot handle it. It is not the exact url for that
document.

Currently, why not use Office COM API to open it and then call SaveAs
function to download it from web server to local file system? We can parse
the downloaded document as we want.


Best regards,
Colbert Zhou
Microsoft Newsgroup Support Team.
 
D

David Thielen

Hi Dave,

The first link should be the document in Office live's page. It is a html
file. So after we use WebRequest and WebResponse to download the html file
and store it as Office document, we will see javascript error in the file.

The second link seems only understood by the Office Live AddIn. As a
result, the Office application can retrieve and open it, but the IE and
WebRequest/WebResponse cannot handle it. It is not the exact url for that
document.

Currently, why not use Office COM API to open it and then call SaveAs
function to download it from web server to local file system? We can parse
the downloaded document as we want.

First off, doesn't SaveAs then make that the file they are editing?
And so when they edit it some more and save it is not being written
back to OfficeLive.

Second, what if their permissions are such that they cannot write a
file to their local disk - it's OfficeLive only?

Can you please ask the Office team how I am supposed to get the file
based on the info returned to me by the Office COM API? They are
returning that special URL for some reason so there must be a way to
use that to get 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
 
C

Colbert Zhou [MSFT]

Hi Dave,

I mean we can use COM API's to start an invisiable Word application. This
invisible Word will open and saveas the document. So that it acts like we
using WebRequest and WebResponse to download the file. That is to say, in
the progress, the end users are not designed to operate against the
document. Of course, the disadvantage is we have to store it in the local
driver firstly. From my understanding, the real url will not be exposed for
security reasons, but I am also trying to consult the internel Office Live
discussion channel to see if there is a opened url for a speicifed Office
Live document. I will let you know as soon as I got any reply from them.

Have a nice day!

Best regards,
Colbert Zhou
Microsoft Newsgroup Support Team
 
D

David Thielen

Hi Dave,

I mean we can use COM API's to start an invisiable Word application. This
invisible Word will open and saveas the document. So that it acts like we
using WebRequest and WebResponse to download the file. That is to say, in
the progress, the end users are not designed to operate against the
document. Of course, the disadvantage is we have to store it in the local
driver firstly. From my understanding, the real url will not be exposed for
security reasons, but I am also trying to consult the internel Office Live
discussion channel to see if there is a opened url for a speicifed Office
Live document. I will let you know as soon as I got any reply from them.

Spawning an invisible Word app would probably have lots of issues.
I'll hope that you get an answer from the OfficeLive team.

We are able to successfully open an OfficeLive file using the public
URL. The problem is the URL that Document.FullName returns.

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