'MS Word 2010 Could not open macro storage

I am creating Word Document Using Word Template

Following is code

  Word.Document wordDoc = new Word.Document();
 wordDoc = wordApp.Documents.Add(ref oTemplatePath, ref oMissing, ref oMissing, ref oMissing);

i am getting error Could not open macro storage. I apply DCOM security permission and all Read/Write permission.

My Server is Windows 2008 Professorial & IIS 7



Solution 1:[1]

The template probably contains a macro. You should set Trust access to the VBA project object model in Macro Setting in Word. See http://support.microsoft.com/kb/282830/en-us or http://support.microsoft.com/kb/303872/en-us

Note, that there is a possibility change this setting from DCOM, but I haven't got it work.

Solution 2:[2]

For me it's working when accessed by hostname and not by IP address. Template is located on network share.

Solution 3:[3]

I've seen this error happen when a document is loaded from a template but the template is NOT in a 'trusted' location. Happens with or without macros in the specified template.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Roman Plischke
Solution 2 mursel.musabasic
Solution 3 SlowLearner