Home Page
Articoli
Tips & Tricks
News
Forum
Archivio Forum
Blogs
Sondaggi
Rss
Video
Utenti
Chi Siamo
Contattaci
Username:
Password:
Login
Registrati ora!
Recupera Password
Home Page
Stanze Forum
ASP.NET 2.0 / 3.5 / 4.0
Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLAS...
mercoledì 23 marzo 2011 - 01.17
Elenco Threads
Stanze Forum
Aggiungi ai Preferiti
Cerca nel forum
Elenco Tags
C#
|
.NET 3.5
|
Windows Server 2008
Gemini
Profilo
| Expert
856
messaggi | Data Invio:
mer 23 mar 2011 - 01:17
Ciao a tutti
sto utilizzando questa procedura per recuperare il numero di pagine di un documento word:
public int nPagesDOC(string FileName)
{
int num = 0;
object fileName = FileName;
object readOnly = false;
object isVisible = true;
object objDNS = Word.WdSaveOptions.wdDoNotSaveChanges;
try
{
Word.ApplicationClass WordApp = new Word.ApplicationClass();
// give any file name of your choice.
// the way to handle parameters you don't care about in .NET
object missing = System.Reflection.Missing.Value;
// Make word visible, so you can see what's happening
//WordApp.Visible = true;
// Open the document that was chosen by the dialog
Word.Document aDoc = WordApp.Documents.Open(ref fileName,
ref missing, ref readOnly, ref missing,
ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing,
ref missing, ref isVisible,
ref missing, ref missing, ref missing, ref missing);
Word.WdStatistic stat = Word.WdStatistic.wdStatisticPages;
num = aDoc.ComputeStatistics(stat, ref missing);
WordApp.Quit(ref objDNS, ref missing, ref missing);
aDoc = null;
WordApp = null;
GC.Collect();
}
catch (Exception ex)
{
return -1;
}
return num;
}
utilizzo 3 dll:
Interop.Microsoft.Office.Core.dll
Interop.VBIDE.dll
Interop.Word.dll
In locale va tutto bene, ma su un server a 64 bit ricevo questo errore:
Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
Ho capito che è una questione di versione della dll, ma non so come risolvere questo problema.
Grazie mille
Torna su
Stanze Forum
Elenco Threads
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?
Dopo esserti registrato potrai chiedere
aiuto sul nostro
Forum
oppure aiutare gli altri
Consulta le
Stanze
disponibili.
Registrati ora !