PDA

View Full Version : Document_New not executing when stream file from web



sverin
05-26-2011, 05:04 AM
Hi

I have an web application that bytestreams a dotm file from the server to the webclient. If I open the template directly from the web the Document_New function isn't executed.

However, if I save the file on disk or download it with an <a href=""> then it works.

Anyone else having this problem?

Johan

Frosty
05-31-2011, 02:46 PM
Sounds like a macro security issue. Depending on which version of Word (assuming from .dotm that the macro was developed in Word 2007/2010 -- but is the client also running the same version?) (and which version of which browser you're using), the actual solution will vary.

Just think about how viruses would be deployed to run malicious code, and figure that you have to not deploy your code in a similar fashion.

Most computers have a different set of security for things running directly from the web vs. something running from the local machine. You will need to figure out the strategy to differentiate your code from malicious code (trusted zone in IE, trusted locations in Word, etc).

A good interim step would probably be to see if you can run any macro contained in the template once the .dotm is opened directly from the web. I'm not 100% sure what "bytestreams" means, but barring a security issue, there may be a flaw in the entire deployment strategy (i.e., "streaming" a word template as your delivery mechanism for code may not be the way to go)