Thursday, March 29, 2012

Office 2007 documents not appearing in iframe

We've been developing an application for a while which allows display of
office/pdf etc documents within an iframe in a web browser.
However, since installing office 2007 this has stopped working and instead
of them appearing nicely in the iframe they now pop up and appear within the
office program.
Does anyone know if there is a way to alter the behaviour of office 2007 so
that the documents remain embedded within the iframe, or is this something
which I just have to accept.
ThanksAFAIK in both 2007 and previous version this is actually a client dependant
behavior. Try :
http://support.microsoft.com/kb/162059/en-us
Another option could be to use an object tag (not tried)...
Patrice
"T" <T@.discussions.microsoft.com> a crit dans le message de news:
49BA0ADC-30D0-4B2E-8724-F3823CBFD8DD@.microsoft.com...
> We've been developing an application for a while which allows display of
> office/pdf etc documents within an iframe in a web browser.
> However, since installing office 2007 this has stopped working and instead
> of them appearing nicely in the iframe they now pop up and appear within
> the
> office program.
> Does anyone know if there is a way to alter the behaviour of office 2007
> so
> that the documents remain embedded within the iframe, or is this something
> which I just have to accept.
> Thanks
>
Hey thanks. I did as suggested in the support article and it does now open i
n
the iframe.
However, this must have been something the Office 2007 installation messed
around with as everything worked fine before installing 2007. Anyone know wh
y
this was done? Also its not something i can expect all our users to do after
they install office 2007, that they then have to for every office file type
select a check box in folder options to allow them to appear in the browser.
Does anyone have any suggestions?
Cheers
"Patrice" wrote:

> AFAIK in both 2007 and previous version this is actually a client dependan
t
> behavior. Try :
> http://support.microsoft.com/kb/162059/en-us
> Another option could be to use an object tag (not tried)...
> --
> Patrice
>
> "T" <T@.discussions.microsoft.com> a écrit dans le message de news:
> 49BA0ADC-30D0-4B2E-8724-F3823CBFD8DD@.microsoft.com...
>
>
re:
!> http://support.microsoft.com/kb/162059/en-us
That KB needs revision.
The latest document type listed is Office 8.
Office 2007 is Office 12.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Patrice" <http://www.chez.com/scribe/> wrote in message
news:OKO8sV9XHHA.4552@.TK2MSFTNGP05.phx.gbl...
> AFAIK in both 2007 and previous version this is actually a client dependan
t behavior. Try :
> http://support.microsoft.com/kb/162059/en-us
> Another option could be to use an object tag (not tried)...
> --
> Patrice
>
> "T" <T@.discussions.microsoft.com> a crit dans le message de news:
> 49BA0ADC-30D0-4B2E-8724-F3823CBFD8DD@.microsoft.com...
>
I mentionned you could perhaps use an object tag inside your iframe to see
if the document is then forced to be placed inside the IE window...
"T" <T@.discussions.microsoft.com> a crit dans le message de news:
AA9DF605-996F-457E-95C0-A9FE2983D49D@.microsoft.com...
> Hey thanks. I did as suggested in the support article and it does now open
> in
> the iframe.
> However, this must have been something the Office 2007 installation messed
> around with as everything worked fine before installing 2007. Anyone know
> why
> this was done? Also its not something i can expect all our users to do
> after
> they install office 2007, that they then have to for every office file
> type
> select a check box in folder options to allow them to appear in the
> browser.
> Does anyone have any suggestions?
> Cheers
>
> "Patrice" wrote:
>

Office 2007 documents to database, dynamically generate on demand

Hello, I am currently adding some document management functionality to a .Net 2.0 Web app (VB) where I take a file in, save the file to a SQL 2000 database (image datatype), and then allow users to browse and download these files.

This works great for most files my users use -- with the exception of Office 2k7 files

I am able to upload a file, read the file into a binary array and insert into a new record in the database.

However, when I retrieve the binary array and attempt to output the file, there is a problem.

The user is prompted to open or save the file per-usual, however when Word 2007 tries to open the file, there is an error message that says:

"The Office Open XML file Test.docx cannot be opened because there are problems with the contents"

Under "Details" it says:

"The file is corrupt and cannot be opened"

If I click "OK", I am asked whether I want to have Word recover the contents of the document.

If I click "Yes" my document opens and all of the original content is there.

I have been doing some reading, and I know that the new Office 2007 files are really .zip files with XML files that contain formatting and content information.

What I would like to know is, is there a reason why I can't save these files to the database as I have been, and if so, is there a "right" way to do this?

Hi,

Based on my understanding, the users upload the word 2007 files into database and download them with your asp.net application. When you try to open the file that is downloaded, you get the error message above. If I have misunderstood you, please feel free to let me know.

To better understand your issue, could you please confirm the following information:

When we write the file to the client, we should make sure that file doesn't contain HTML-tag. We can add Response.End() right after writing and stop further processing of the ASP.NET page. For more information, seehttp://blog.benday.com/archive/2005/08/09/2705.aspx.


Yes, you have summarized what I am doing correctly.

I have been looking into this in more detail, and after using Hex Workshop, I compared the original file and the streamed file. The streamed file contained 1 extra byte.

I reviewed my code and found that the size of the file in the database was the same as the original, so I reviewed my code in the download.aspx code-behind (the file that streams the requested document).

I had read about this earlier, so I knew not to have any HTML in the aspx.

However, it seems that the Content-Length of the file is zero-based, so when I was setting Content-Length to equal the value I had in the database, an extra byte was being added.

When I set Content-Length to equal the size of the file (in bytes) - 1, I no longer received the error.

Ex:

Dim File As New EO.Library.File(CInt(Request("file")))
Dim _BinaryLength = (CInt(File.Binary.Length) - 1)

Response.Clear()
Response.Buffer = True
Response.AddHeader("Content-Disposition", "attachment;filename=" & File.Name)
Response.AddHeader("Content-Length", CInt(_BinaryLength))
Response.ContentType = File.ContentType
Response.BinaryWrite(File.Binary)
Response.End()

Office 2007 documents not appearing in iframe

We've been developing an application for a while which allows display of
office/pdf etc documents within an iframe in a web browser.

However, since installing office 2007 this has stopped working and instead
of them appearing nicely in the iframe they now pop up and appear within the
office program.

Does anyone know if there is a way to alter the behaviour of office 2007 so
that the documents remain embedded within the iframe, or is this something
which I just have to accept.

ThanksAFAIK in both 2007 and previous version this is actually a client dependant
behavior. Try :
http://support.microsoft.com/kb/162059/en-us
Another option could be to use an object tag (not tried)...

--
Patrice

"T" <T@.discussions.microsoft.coma crit dans le message de news:
49BA0ADC-30D0-4B2E-8724-F3823CBFD8DD@.microsoft.com...

Quote:

Originally Posted by

We've been developing an application for a while which allows display of
office/pdf etc documents within an iframe in a web browser.
>
However, since installing office 2007 this has stopped working and instead
of them appearing nicely in the iframe they now pop up and appear within
the
office program.
>
Does anyone know if there is a way to alter the behaviour of office 2007
so
that the documents remain embedded within the iframe, or is this something
which I just have to accept.
>
Thanks
>


Hey thanks. I did as suggested in the support article and it does now open in
the iframe.

However, this must have been something the Office 2007 installation messed
around with as everything worked fine before installing 2007. Anyone know why
this was done? Also its not something i can expect all our users to do after
they install office 2007, that they then have to for every office file type
select a check box in folder options to allow them to appear in the browser.

Does anyone have any suggestions?

Cheers

"Patrice" wrote:

Quote:

Originally Posted by

AFAIK in both 2007 and previous version this is actually a client dependant
behavior. Try :
http://support.microsoft.com/kb/162059/en-us
>
Another option could be to use an object tag (not tried)...
>
--
Patrice
>
>
>
"T" <T@.discussions.microsoft.coma écrit dans le message de news:
49BA0ADC-30D0-4B2E-8724-F3823CBFD8DD@.microsoft.com...

Quote:

Originally Posted by

We've been developing an application for a while which allows display of
office/pdf etc documents within an iframe in a web browser.

However, since installing office 2007 this has stopped working and instead
of them appearing nicely in the iframe they now pop up and appear within
the
office program.

Does anyone know if there is a way to alter the behaviour of office 2007
so
that the documents remain embedded within the iframe, or is this something
which I just have to accept.

Thanks


>
>
>


re:
!http://support.microsoft.com/kb/162059/en-us
That KB needs revision.
The latest document type listed is Office 8.

Office 2007 is Office 12.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Patrice" <http://www.chez.com/scribe/wrote in message
news:OKO8sV9XHHA.4552@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

AFAIK in both 2007 and previous version this is actually a client dependant behavior. Try :
http://support.microsoft.com/kb/162059/en-us
>
Another option could be to use an object tag (not tried)...
>
--
Patrice
>
>
>
"T" <T@.discussions.microsoft.coma crit dans le message de news:
49BA0ADC-30D0-4B2E-8724-F3823CBFD8DD@.microsoft.com...

Quote:

Originally Posted by

>We've been developing an application for a while which allows display of
>office/pdf etc documents within an iframe in a web browser.
>>
>However, since installing office 2007 this has stopped working and instead
>of them appearing nicely in the iframe they now pop up and appear within the
>office program.
>>
>Does anyone know if there is a way to alter the behaviour of office 2007 so
>that the documents remain embedded within the iframe, or is this something
>which I just have to accept.
>>
>Thanks
>>


>
>


I mentionned you could perhaps use an object tag inside your iframe to see
if the document is then forced to be placed inside the IE window...

"T" <T@.discussions.microsoft.coma crit dans le message de news:
AA9DF605-996F-457E-95C0-A9FE2983D49D@.microsoft.com...

Quote:

Originally Posted by

Hey thanks. I did as suggested in the support article and it does now open
in
the iframe.
>
However, this must have been something the Office 2007 installation messed
around with as everything worked fine before installing 2007. Anyone know
why
this was done? Also its not something i can expect all our users to do
after
they install office 2007, that they then have to for every office file
type
select a check box in folder options to allow them to appear in the
browser.
>
Does anyone have any suggestions?
>
Cheers
>
>
>
"Patrice" wrote:
>

Quote:

Originally Posted by

>AFAIK in both 2007 and previous version this is actually a client
>dependant
>behavior. Try :
>http://support.microsoft.com/kb/162059/en-us
>>
>Another option could be to use an object tag (not tried)...
>>
>--
>Patrice
>>
>>
>>
>"T" <T@.discussions.microsoft.coma crit dans le message de news:
>49BA0ADC-30D0-4B2E-8724-F3823CBFD8DD@.microsoft.com...

Quote:

Originally Posted by

We've been developing an application for a while which allows display
of
office/pdf etc documents within an iframe in a web browser.
>
However, since installing office 2007 this has stopped working and
instead
of them appearing nicely in the iframe they now pop up and appear
within
the
office program.
>
Does anyone know if there is a way to alter the behaviour of office
2007
so
that the documents remain embedded within the iframe, or is this
something
which I just have to accept.
>
Thanks
>


>>
>>
>>

office automation

Hello,

I have written a bunch of apps in vb .net that automated different office apps. I am very new to asp however. I created an asp .net web application in vs net added a button to a form and inserted this code:


Dim xlapp As Excel.Application
Response.Write("excel")
'Response.Write("fname = " & Fname)
xlapp = New Excel.Application

and it crashes with an access denied error

ive read some things on line about automating office with asp but they always seem to use c code and i would much rather use vb code

any help/advice or places i can go to read up on this would be greatly appreciated

ThanksHi,

Take a look @.Create and Modify Excel Files (VB)

HTH

Office Automation - Powerpoint in VB.Net

Hi

I tried to do the Powerpoint presentation using VB.Net 2.0. I got error while creating the object of the Powerpoint.Application

Unable to cast COM object of type 'PowerPoint.ApplicationClass' to interface type 'PowerPoint._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{91493442-5A91-11CF-8700-00AA0060263B}' failed due to the following error: Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)).


Can any one tell me the solution for this error.?

Ganesh.

Hi Ganesh,

The error indicates that the PowerPoint.ApplicationClass was not registered on the running machine properly. A COM class needs to be registered in the registery to make it identified. The register process is done at the installation phase of Office.

So you can try to repair the installation of PowerPoint or make sure it is installed properly.

Further more, in an ASP.NET application, server side automation is not supported. Here is a KB article about this.

http://support.microsoft.com/kb/257757/en-us

Hope this helps.

office automation

I want to count words of .doc ,.ppt,.xls,.html,.rtf i done all things with
interop but it is not working on my webserver so do you know any component by
which i give facility in my application to count words
Kbalz wrote:

Quote:

Originally Posted by

Quote:

Originally Posted by

Quote:

Originally Posted by

you say for this link i try it but it is not working


>>


>[quoted text clipped - 14 lines]

Quote:

Originally Posted by

>Mark Rae
>ASP.NET MVPhttp://www.markrae.net


>
>The automation could save you $500 quickly depending on what scale of
>usage you are talking about.


--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/Fo...sp-net/200710/1"akshar108 via DotNetMonster.com" <u37462@.uwewrote in message
news:79383d837bf05@.uwe...

Quote:

Originally Posted by

I want to count words of .doc ,.ppt,.xls,.html,.rtf i done all things with
interop but it is not working on my webserver so do you know any component
by
which i give facility in my application to count words


http://www.aspose.com/Products/Default.aspx
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

office automation securiy error

Hi. While trying to create a a word document in one of my asp.net pages I
keep getting an ASP.NET permission error. first I thought it was been caused
while trying to save the document, and I added permissions for the ASP.NET
account to my folders. after that I realized that the error was being
launche at the very first line of my function:
Word.ApplicationClass WordApp = new Word.ApplicationClass();
any ideas on how to solve this?
Thanks a lot,
Alejandro.For those who need the answer visit this link:
http://www.codeproject.com/aspnet/w...9372#xx999372xx
"Alejandro Penate-Diaz" <alexware69@.hotmail.com> wrote in message
news:%239TUIGSOFHA.1476@.TK2MSFTNGP09.phx.gbl...
> Hi. While trying to create a a word document in one of my asp.net pages I
> keep getting an ASP.NET permission error. first I thought it was been
> caused while trying to save the document, and I added permissions for the
> ASP.NET account to my folders. after that I realized that the error was
> being launche at the very first line of my function:
> Word.ApplicationClass WordApp = new Word.ApplicationClass();
> any ideas on how to solve this?
> Thanks a lot,
> Alejandro.
>
>
Not to be a nark or anything, but I think the licensing for office prohibits
this sort of usage on a webserver. Or, rather, you're supposed to have a
license for office for each user using your web application. At least this
is my understanding. I'd check the EULA.
BTW, this should be unrelated to the permission problem ;)
-Brock
DevelopMentor
http://staff.develop.com/ballen

> Hi. While trying to create a a word document in one of my asp.net
> pages I keep getting an ASP.NET permission error. first I thought it
> was been caused while trying to save the document, and I added
> permissions for the ASP.NET account to my folders. after that I
> realized that the error was being launche at the very first line of my
> function:
> Word.ApplicationClass WordApp = new Word.ApplicationClass();
> any ideas on how to solve this?
> Thanks a lot,
> Alejandro.
It's probably a security issue.
The ASPNET user account does have permission to run office by default.
You can use impersonation to have ASP.NET run under a different user account
that does have the necessary permission.
For example, you can add a line similar to this to your web.config file:
<identity impersonate="true" userName="domain\MyUserName">
password="password"/>
Here's more info on impersonation:
http://msdn.microsoft.com/library/d...personation.asp
Here's more info on generating office documents, including the wrong ways
(like office automation) and the right ways:
http://SteveOrr.net/articles/ExcelExport.aspx
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Alejandro Penate-Diaz" <alexware69@.hotmail.com> wrote in message
news:%239TUIGSOFHA.1476@.TK2MSFTNGP09.phx.gbl...
> Hi. While trying to create a a word document in one of my asp.net pages I
> keep getting an ASP.NET permission error. first I thought it was been
> caused while trying to save the document, and I added permissions for the
> ASP.NET account to my folders. after that I realized that the error was
> being launche at the very first line of my function:
> Word.ApplicationClass WordApp = new Word.ApplicationClass();
> any ideas on how to solve this?
> Thanks a lot,
> Alejandro.
>
>