Error in COM Microsoft.Office.Interop



I have an application made in .net. This program link with formfields
in word application.
This is the code:

Dim wdApp As ObjectDim wdDoc As New Word.Document
Dim strLabelName = ruta + "\"

wdApp = CreateObject("Word.Application")

wdApp.Visible = TruewdDoc = wdApp.Documents.Add(strLabelName)

With wdDoc
..FormFields("txt_oferta").Result = oferta
..FormFields("txt_nombre").Result = nombre
end with

In all computers of my enterprise, work perfectly but, in the
manager's computer doesn't work, bad luck :( . The program run well,
but fails when it arrives the line ".FormFields("txt_oferta").Result =
the error is
Unable to cast COM object of
type'Microsoft.Office.Interop.Word.DocumentClass' to interface
type'Microsoft.Office.Interop.Word._Document'. This operation failed
because theQueryInterface call on the COM component for the interface
with IID'{0002096B-0000-0000-C000-000000000046}' failed due to the
following error:The application called an interface that was
marshalled for a differentthread. (Exception from HRESULT: 0x80004002

I installed microsoft office 2003 primary interop assemblies but it
doesn't work.

any ideas?
I'm a little bit desperate. :)

thank you very much.


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