Why does Word not like this docx file

D

David Thielen

Hi;

Take a look at http://www.windwardreports.com/temp/BadDocx.zip - the
file CannotRead.docx is a DOCX file we create. Word thinks it's a bad
zip file. I open CannotRead.docx in WinZip with no problem. I then
cause WinZip to save the file as AfterWinZipSave.docx. Same zip file,
same contents - and now Word can read it.

What is Word unhappy about? We use SharpZipLib and have never hit a
problem like this before.

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,

Got the file and had a repro on my machine.

Is this problem happening to all the DOCX files you generated, or is there
any patterns to reproduce the issue, or it is just random?

What version of SharpZipLib are you using?

Please give me more information if you could.

And I will take a closer look at the sample document to find out why.

Regards,

Jie Wang ([email protected], remove 'online.')

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

Just this 1 file.

SharpZipLib 0.85.4.369. I will try 0.85.5.

thanks - dave


Hi David,

Got the file and had a repro on my machine.

Is this problem happening to all the DOCX files you generated, or is there
any patterns to reproduce the issue, or it is just random?

What version of SharpZipLib are you using?

Please give me more information if you could.

And I will take a closer look at the sample document to find out why.

Regards,

Jie Wang ([email protected], remove 'online.')

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.


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]

Tony, thank you for testing it. I did some more tests too. And here is the
results so far:

Word 2003 + 2007 Compatibility Pack: Can Open

Word 2007 SP1: Can Open

Word 2007 SP2: CANNOT Open

I've sent the file for further investigation.

David, what's your version(s) of Word for testing this file?

Thanks,

Jie Wang ([email protected], remove 'online.')

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

Word 2007 - all service packs applied.

thanks - dave


Tony, thank you for testing it. I did some more tests too. And here is the
results so far:

Word 2003 + 2007 Compatibility Pack: Can Open

Word 2007 SP1: Can Open

Word 2007 SP2: CANNOT Open

I've sent the file for further investigation.

David, what's your version(s) of Word for testing this file?

Thanks,

Jie Wang ([email protected], remove 'online.')

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.


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,

I tried SharpZipLib 0.85.5, to generate (using the FastZip class) the same
document with the same contents in it. This time the generated document can
be opened by Word 2007 SP2 with no problem.

I also tried the file with the latest Open XML Format SDK 2.0 APIs, the
document cannot be opened. The error information indicates the main
document part cannot be found in the package.

It is hard to say which of the many changes in SP2 might have caused this
problem. It may be that some fix to imporve security or some other changes
we made in SP2 is finding a problem with the SharpZipLib generated file
that earlier versions did not notice.

So I suggest you try the latest SharpZipLib and see if the problem is still
there.

For long term, I also suggest you use the Open XML Format SDK 2.0 APIs
(http://msdn.microsoft.com/en-us/library/bb448854(office.14).aspx) to
generate Word/Excel/PowerPoint files, which comes with some handy tools
(like a reflector tool to generate C# code from a Office document) and will
have better support from Microsoft. It is currently in the CTP stage, but
definitely worth for some studies.

Please let me know if you have any updates on the SharpZipLib 0.85.5
version.

Regards,

Jie Wang ([email protected], remove 'online.')

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.
 
T

Tony Jollans

I'm a long way from an expert on this but it seems to me that the CannotRead
document does not strictly adhere to the zip standard, and some programs are
more tolerant of this than others. It looks as though the length fields for
the lengths of the compressed and uncompressed data in the data descriptor
blocks are 8 bytes rather than 4 bytes each; this should only happen if the
file is in Zip64 format, which it isn't. Winzip does manage to read the
files and the AfterWinZipSave file it creates uses 4-byte length fields.

If my reading is correct then the problem is in the program doing the
zipping (SharpZipLib).

--
Enjoy,
Tony

www.WordArticles.com

"Jie Wang [MSFT]" said:
Hi David,

I tried SharpZipLib 0.85.5, to generate (using the FastZip class) the same
document with the same contents in it. This time the generated document
can
be opened by Word 2007 SP2 with no problem.

I also tried the file with the latest Open XML Format SDK 2.0 APIs, the
document cannot be opened. The error information indicates the main
document part cannot be found in the package.

It is hard to say which of the many changes in SP2 might have caused this
problem. It may be that some fix to imporve security or some other changes
we made in SP2 is finding a problem with the SharpZipLib generated file
that earlier versions did not notice.

So I suggest you try the latest SharpZipLib and see if the problem is
still
there.

For long term, I also suggest you use the Open XML Format SDK 2.0 APIs
(http://msdn.microsoft.com/en-us/library/bb448854(office.14).aspx) to
generate Word/Excel/PowerPoint files, which comes with some handy tools
(like a reflector tool to generate C# code from a Office document) and
will
have better support from Microsoft. It is currently in the CTP stage, but
definitely worth for some studies.

Please let me know if you have any updates on the SharpZipLib 0.85.5
version.

Regards,

Jie Wang ([email protected], remove 'online.')

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