Está en la página 1de 7

Word in iis

Pwd: YessicaMedina02
Programación .NET, Linux, SharePoint

Menú
Saltar al contenido.

 Inicio
 About

5Jun2013

Error en Microsoft.Office.Interop.Word
en IIS
Publicado en .NET, IIS, Office por mittaus

La libreria de Microsoft Office “Microsoft.Office.Interop.Word” nos sirve para


generar archivos Word, Excel desde nuestro código fuente.
Si nuestro proyecto es tipo Web entonces estará alojado en IIS y quizá se
encuentre con un error similar a
Timestamp: 05/06/2013 02:19:59 p.m.
Message: HandlingInstanceID: b75f03af-3973-481c-8307-0b59f37d5122
An exception of type 'System.Runtime.InteropServices.COMException'
occurred and was caught.
-------------------------------------------------------------------------
------------------
06/05/2013 09:19:59
Type : System.Runtime.InteropServices.COMException, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : Retrieving the COM class factory for component with CLSID
{000209FF-0000-0000-C000-000000000046} failed due to the following error:
8000401a.
Source : SysEsanCole
Help link :
ErrorCode : -2147467238
Data : System.Collections.ListDictionaryInternal

Y quizá en su código fuente tengan algo similar a esto:


wordApp = new Microsoft.Office.Interop.Word.Application();
wordApp.Visible = false;
wordDocument = wordApp.Documents.Open(ref filePath, ref missing, ref
trueValue, 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);

Y cuando ejecuten su proyecto la variable wordDocument es null y por lo tanto


generará una excepción

Para solucionar el problema pueden seguir estos pasos:

PASO 1:

En el servidor Web van a: Menú inicio / Panel de control / Herramientas


administrativas / Component Services

Esto abrirá el programa “component Services”, en el programa vamos a las


opciones:

Component Services / Computers / My Computer / DCOM Config / Microsoft


Office Word 97 – 2003 Document
Click derecho / Propiedades
Anuncios
INFORMA SOBRE ESTE ANUNCIO

En Tab Identity > Seleccionar «The interactive User»

En Tab Secutiry > Launch and Activation Permissions


 Agregar “IUSR_<machinename>” (para XP)
 Agregar “Network Service” (para Windows VISTA, Windows 7,
Windows Server 2008)

Guardar la configuración

NOTA:
Anuncios
INFORMA SOBRE ESTE ANUNCIO

Si en el servidor se tiene instalado una version superior a Word 2003 y aun así
sale solo “Microsoft Word 97 – 2003 Document” en “Component
Services” no se preocupen.

Para comprobar que el “Microsoft Word 97 – 2003 Document” hace referencia


a la versión de Word que tenemos instalado en el servidor realizamos las
siguientes acciones:

1. Abrir el Registro de Windows (regedit)

2. Buscar winword.exe, esto está en “HKEY_CLASSES_ROOT\AppID\


WINWORD.EXE” lo necesitamos para ver la AppId/Guid del Word que
tenemos instalado.

3. Abrir Compent Services (dcomcnfg), Ir a Computers / MyComputer


/DCOM Cnfg/Microsoft Word 97 – 2003 Document

4. La Guid del punto 2 con el punto 3 deben coincidir


PASO 2:

Abre tu Directorio Virtual en IIS


Para XP:

1. Abrir Inetmgr
2. Abrir as propiedades del Directorio Virtual
3. Seleccionar el tab «Directory Security».
4. Click en «Edit» under anonymous access and authentication control
5. Dialog box will get opened there you just click on browse
6. then Click on «Advanced» and then «find now»
7. All the user list will get displayed from hem you select the admin account
(any admin user is good)

Para Windows Vista, Windows 7, Windows Server 2008

1. Abrir Inetmgr
2. Abrir as propiedades del Directorio Virtual
3. Seleccionar «Authentication»
4. Edit anonymous authentication
5. Dialog box will get opened > click on set > admin user (any admin user is
good)

PASO 3:

Crear un directorio con nombre «Desktop» dentro de «C:\Windows\


SysWOW64\config\systemprofile\» o «C:\Windows\System32\config\
systemprofile\»

de acuerdo al sistema operativo y la version de office instalada.

Referencias:

http://social.msdn.microsoft.com/Forums/en-US/architecturegeneral/thread/
faf17c78-2d5f-44b7-806c-e7a0751b7613

http://social.msdn.microsoft.com/Forums/en-US/architecturegeneral/thread/
0f5448a7-72ed-4f16-8b87-922b71892e07

También podría gustarte