首页 新闻 会员 周边 捐助

C#生成word,使用的是微软的Microsoft.Office.Interop.Word.dll,报错。

0
悬赏园豆:50 [已解决问题] 解决于 2015-07-22 09:18

服务器配置:windows server 2008 r2 64位, 部署在IIS里,一直报错。网上的方法都试过,例如:在组件服务里面改权限改配置,在C:\Windows\System32\config\systemprofile里文件夹新建Desktop文件夹。另一台笔记本使用以上的解决方法已解决,但是这台服务器上就是不可以,此服务器安装过WPS(目前已卸载),office我重装了好几遍。园子里有哪位大神给点解决思路或者建议,跪求!!!纠结了好几天了这个问题。

问题补充:

报错信息: System.Runtime.InteropServices.COMException (0x80029C4A): 加载类型库/DLL 时出错。 (异常来自 HRESULT:0x80029C4A (TYPE_E_CANTLOADLIBRARY))

Jehuty'的主页 Jehuty' | 初学一级 | 园豆:79
提问于:2015-07-21 16:45
< >
分享
最佳答案
0

因为你之前安装过 WPS,所以我建议你先建立一个 Console 程序测试下,如果无法成功创建 Word 对象,你再过来,然后我告诉你如何修改。

收获园豆:50
Launcher | 高人七级 |园豆:45050 | 2015-07-21 16:49

试过了,不能创建Word 对象,就是在这一步报错的,而且是只有这一台服务器报错(目前)

Jehuty' | 园豆:79 (初学一级) | 2015-07-21 16:54

@Jehuty': 打开注册表,在 KEY_CLASSES_ROOT 下找到 Word.Application 和 Word.Application.x(这个 x 表示你安装的 Office 版本)。

Launcher | 园豆:45050 (高人七级) | 2015-07-21 17:00

@Launcher: Word.Application的CurVer值是Word.Application.12,然后还存在Word.Application.11,Word.Application.12,Word.Application.14,Word.Application.8.我需要怎么改

Jehuty' | 园豆:79 (初学一级) | 2015-07-21 17:03

@Jehuty': 因为 CurVer 是 12,所以你先检查下机器上是否安装了 Office 12,如果不是,把 CurVer 修改成机器上已经安装的 Office 版本。

Launcher | 园豆:45050 (高人七级) | 2015-07-21 17:07

@Launcher: 12就是office2007,已安装了的。同时还找到了WPS.Dotm.6和WPS.Dotx.6注册表信息

Jehuty' | 园豆:79 (初学一级) | 2015-07-21 17:12

@Jehuty': 在 KEY_CLASSES_ROOT\Interface 下搜索 00020970-0000-0000-c000-000000000046 ,把 TypeLib 的默认和 Version 记下来。

Launcher | 园豆:45050 (高人七级) | 2015-07-21 17:19

@Launcher: TypeLib 值{00020905-0000-4B30-A977-D214852036FF},Version 值3.0

Jehuty' | 园豆:79 (初学一级) | 2015-07-21 17:25

@Jehuty': 你先去其它能正确运行的机器上,检查下这个值是否是一致的,如果不一致,用正确机器上的值修改之。

PS:此值应该为:00020905-0000-0000-C000-000000000046

Launcher | 园豆:45050 (高人七级) | 2015-07-21 17:29

@Launcher: 已改为00020905-0000-0000-C000-000000000046,但是还是不行,错误信息没变

Jehuty' | 园豆:79 (初学一级) | 2015-07-21 17:39

@Jehuty': 万里长征才走完第一步,你别急,现在使用 00020905-0000-0000-C000-000000000046 在 KEY_CLASSES_ROOT\Typelib 或 KEY_CLASSES_ROOT\Wow6432Node\Typelib下搜索,找到后,展开,选择名称为版本号的项,,选择“0”项,选择“Win32”项,看其默认的键值是否为你安装的 word 的路径,通常路径应该为:xxx\Office12\MSWORD.OLB。

Launcher | 园豆:45050 (高人七级) | 2015-07-21 17:42

@Launcher: 是的,但是我发现没有3.0的版本号,只要8.4的,我另一台机器上也是8.4的版本号(office安装包都一样)

Jehuty' | 园豆:79 (初学一级) | 2015-07-21 17:47

@Jehuty': 那就回到这里:KEY_CLASSES_ROOT\Interface\00020970-0000-0000-c000-000000000046 下,把版本号修改为 8.4,同时也要修改 32 位版本的,在 KEY_CLASSES_ROOT\Wow6432Node\Interface\00020970-0000-0000-c000-000000000046。

Launcher | 园豆:45050 (高人七级) | 2015-07-21 17:48

@Launcher: 已改

Jehuty' | 园豆:79 (初学一级) | 2015-07-21 17:50

@Jehuty': 哪个 win32 的键值的路径对了吗?

Launcher | 园豆:45050 (高人七级) | 2015-07-21 17:53

@Launcher: 是对的,可以找到那个路径

Jehuty' | 园豆:79 (初学一级) | 2015-07-21 17:55

@Jehuty': 如果上面的都对了后,接下来就是比较繁琐的操作了,主要看你需要用到哪些对象。去你正常的机器的注册表,在 KEY_CLASSES_ROOT\CLSID 和 KEY_CLASSES_ROOT\Wow6432Node\CLSID 下使用 00020905-0000-0000-C000-000000000046 搜索,把搜索到的的项都复制到你出错的机器上的注册表中去。

Launcher | 园豆:45050 (高人七级) | 2015-07-21 17:56

@Jehuty': 我要下班了,我给你个列表:

//
// Forward references and typedefs
//

struct __declspec(uuid("00020970-0000-0000-c000-000000000046"))
/* dual interface */ _Application;
struct __declspec(uuid("000209b9-0000-0000-c000-000000000046"))
/* dual interface */ _Global;
struct __declspec(uuid("0002096f-0000-0000-c000-000000000046"))
/* dual interface */ FontNames;
struct __declspec(uuid("0002096e-0000-0000-c000-000000000046"))
/* dual interface */ Languages;
struct __declspec(uuid("0002096d-0000-0000-c000-000000000046"))
/* dual interface */ Language;
struct __declspec(uuid("0002096c-0000-0000-c000-000000000046"))
/* dual interface */ Documents;
struct __declspec(uuid("0002096b-0000-0000-c000-000000000046"))
/* dual interface */ _Document;
struct __declspec(uuid("0002096a-0000-0000-c000-000000000046"))
/* dual interface */ Template;
struct __declspec(uuid("000209a2-0000-0000-c000-000000000046"))
/* dual interface */ Templates;
struct __declspec(uuid("00020969-0000-0000-c000-000000000046"))
/* dual interface */ RoutingSlip;
struct __declspec(uuid("00020968-0000-0000-c000-000000000046"))
/* dual interface */ Bookmark;
struct __declspec(uuid("00020967-0000-0000-c000-000000000046"))
/* dual interface */ Bookmarks;
struct __declspec(uuid("00020966-0000-0000-c000-000000000046"))
/* dual interface */ Variable;
struct __declspec(uuid("00020965-0000-0000-c000-000000000046"))
/* dual interface */ Variables;
struct __declspec(uuid("00020964-0000-0000-c000-000000000046"))
/* dual interface */ RecentFile;
struct __declspec(uuid("00020963-0000-0000-c000-000000000046"))
/* dual interface */ RecentFiles;
struct __declspec(uuid("00020962-0000-0000-c000-000000000046"))
/* dual interface */ Window;
struct __declspec(uuid("00020961-0000-0000-c000-000000000046"))
/* dual interface */ Windows;
struct __declspec(uuid("00020960-0000-0000-c000-000000000046"))
/* dual interface */ Pane;
struct __declspec(uuid("0002095f-0000-0000-c000-000000000046"))
/* dual interface */ Panes;
struct __declspec(uuid("0002095e-0000-0000-c000-000000000046"))
/* dual interface */ Range;
struct __declspec(uuid("000209c0-0000-0000-c000-000000000046"))
/* dual interface */ ListFormat;
struct __declspec(uuid("000209b0-0000-0000-c000-000000000046"))
/* dual interface */ Find;
struct __declspec(uuid("000209b1-0000-0000-c000-000000000046"))
/* dual interface */ Replacement;
struct __declspec(uuid("0002095d-0000-0000-c000-000000000046"))
/* dual interface */ Characters;
struct __declspec(uuid("0002095c-0000-0000-c000-000000000046"))
/* dual interface */ Words;
struct __declspec(uuid("0002095b-0000-0000-c000-000000000046"))
/* dual interface */ Sentences;
struct __declspec(uuid("0002095a-0000-0000-c000-000000000046"))
/* dual interface */ Sections;
struct __declspec(uuid("00020959-0000-0000-c000-000000000046"))
/* dual interface */ Section;
struct __declspec(uuid("00020958-0000-0000-c000-000000000046"))
/* dual interface */ Paragraphs;
struct __declspec(uuid("00020957-0000-0000-c000-000000000046"))
/* dual interface */ Paragraph;
struct __declspec(uuid("00020956-0000-0000-c000-000000000046"))
/* dual interface */ DropCap;
struct __declspec(uuid("00020955-0000-0000-c000-000000000046"))
/* dual interface */ TabStops;
struct __declspec(uuid("00020954-0000-0000-c000-000000000046"))
/* dual interface */ TabStop;
struct __declspec(uuid("00020953-0000-0000-c000-000000000046"))
/* dual interface */ _ParagraphFormat;
struct __declspec(uuid("00020952-0000-0000-c000-000000000046"))
/* dual interface */ _Font;
struct __declspec(uuid("00020951-0000-0000-c000-000000000046"))
/* dual interface */ Table;
struct __declspec(uuid("00020950-0000-0000-c000-000000000046"))
/* dual interface */ Row;
struct __declspec(uuid("0002094f-0000-0000-c000-000000000046"))
/* dual interface */ Column;
struct __declspec(uuid("0002094e-0000-0000-c000-000000000046"))
/* dual interface */ Cell;
struct __declspec(uuid("0002094d-0000-0000-c000-000000000046"))
/* dual interface */ Tables;
struct __declspec(uuid("0002094c-0000-0000-c000-000000000046"))
/* dual interface */ Rows;
struct __declspec(uuid("0002094b-0000-0000-c000-000000000046"))
/* dual interface */ Columns;
struct __declspec(uuid("0002094a-0000-0000-c000-000000000046"))
/* dual interface */ Cells;
struct __declspec(uuid("00020949-0000-0000-c000-000000000046"))
/* dual interface */ AutoCorrect;
struct __declspec(uuid("00020948-0000-0000-c000-000000000046"))
/* dual interface */ AutoCorrectEntries;
struct __declspec(uuid("00020947-0000-0000-c000-000000000046"))
/* dual interface */ AutoCorrectEntry;
struct __declspec(uuid("00020946-0000-0000-c000-000000000046"))
/* dual interface */ FirstLetterExceptions;
struct __declspec(uuid("00020945-0000-0000-c000-000000000046"))
/* dual interface */ FirstLetterException;
struct __declspec(uuid("00020944-0000-0000-c000-000000000046"))
/* dual interface */ TwoInitialCapsExceptions;
struct __declspec(uuid("00020943-0000-0000-c000-000000000046"))
/* dual interface */ TwoInitialCapsException;
struct __declspec(uuid("00020942-0000-0000-c000-000000000046"))
/* dual interface */ Footnotes;
struct __declspec(uuid("00020941-0000-0000-c000-000000000046"))
/* dual interface */ Endnotes;
struct __declspec(uuid("00020940-0000-0000-c000-000000000046"))
/* dual interface */ Comments;
struct __declspec(uuid("0002093f-0000-0000-c000-000000000046"))
/* dual interface */ Footnote;
struct __declspec(uuid("0002093e-0000-0000-c000-000000000046"))
/* dual interface */ Endnote;
struct __declspec(uuid("0002093d-0000-0000-c000-000000000046"))
/* dual interface */ Comment;
struct __declspec(uuid("0002093c-0000-0000-c000-000000000046"))
/* dual interface */ Borders;
struct __declspec(uuid("0002093b-0000-0000-c000-000000000046"))
/* dual interface */ Border;
struct __declspec(uuid("0002093a-0000-0000-c000-000000000046"))
/* dual interface */ Shading;
struct __declspec(uuid("00020939-0000-0000-c000-000000000046"))
/* dual interface */ TextRetrievalMode;
struct __declspec(uuid("00020937-0000-0000-c000-000000000046"))
/* dual interface */ AutoTextEntries;
struct __declspec(uuid("00020936-0000-0000-c000-000000000046"))
/* dual interface */ AutoTextEntry;
struct __declspec(uuid("00020935-0000-0000-c000-000000000046"))
/* dual interface */ System;
struct __declspec(uuid("00020933-0000-0000-c000-000000000046"))
/* dual interface */ OLEFormat;
struct __declspec(uuid("00020931-0000-0000-c000-000000000046"))
/* dual interface */ LinkFormat;
struct __declspec(uuid("000209a4-0000-0000-c000-000000000046"))
/* dual interface */ _OLEControl;
struct __declspec(uuid("00020930-0000-0000-c000-000000000046"))
/* dual interface */ Fields;
struct __declspec(uuid("0002092f-0000-0000-c000-000000000046"))
/* dual interface */ Field;
struct __declspec(uuid("0002092e-0000-0000-c000-000000000046"))
/* dual interface */ Browser;
struct __declspec(uuid("0002092d-0000-0000-c000-000000000046"))
/* dual interface */ Styles;
struct __declspec(uuid("0002092c-0000-0000-c000-000000000046"))
/* dual interface */ Style;
struct __declspec(uuid("0002092b-0000-0000-c000-000000000046"))
/* dual interface */ Frames;
struct __declspec(uuid("0002092a-0000-0000-c000-000000000046"))
/* dual interface */ Frame;
struct __declspec(uuid("00020929-0000-0000-c000-000000000046"))
/* dual interface */ FormFields;
struct __declspec(uuid("00020928-0000-0000-c000-000000000046"))
/* dual interface */ FormField;
struct __declspec(uuid("00020927-0000-0000-c000-000000000046"))
/* dual interface */ TextInput;
struct __declspec(uuid("00020926-0000-0000-c000-000000000046"))
/* dual interface */ CheckBox;
struct __declspec(uuid("00020925-0000-0000-c000-000000000046"))
/* dual interface */ DropDown;
struct __declspec(uuid("00020924-0000-0000-c000-000000000046"))
/* dual interface */ ListEntries;
struct __declspec(uuid("00020923-0000-0000-c000-000000000046"))
/* dual interface */ ListEntry;
struct __declspec(uuid("00020922-0000-0000-c000-000000000046"))
/* dual interface */ TablesOfFigures;
struct __declspec(uuid("00020921-0000-0000-c000-000000000046"))
/* dual interface */ TableOfFigures;
struct __declspec(uuid("00020920-0000-0000-c000-000000000046"))
/* dual interface */ MailMerge;
struct __declspec(uuid("0002091f-0000-0000-c000-000000000046"))
/* dual interface */ MailMergeFields;
struct __declspec(uuid("0002091e-0000-0000-c000-000000000046"))
/* dual interface */ MailMergeField;
struct __declspec(uuid("0002091d-0000-0000-c000-000000000046"))
/* dual interface */ MailMergeDataSource;
struct __declspec(uuid("0002091c-0000-0000-c000-000000000046"))
/* dual interface */ MailMergeFieldNames;
struct __declspec(uuid("0002091b-0000-0000-c000-000000000046"))
/* dual interface */ MailMergeFieldName;
struct __declspec(uuid("0002091a-0000-0000-c000-000000000046"))
/* dual interface */ MailMergeDataFields;
struct __declspec(uuid("00020919-0000-0000-c000-000000000046"))
/* dual interface */ MailMergeDataField;
struct __declspec(uuid("00020918-0000-0000-c000-000000000046"))
/* dual interface */ Envelope;
struct __declspec(uuid("00020917-0000-0000-c000-000000000046"))
/* dual interface */ MailingLabel;
struct __declspec(uuid("00020916-0000-0000-c000-000000000046"))
/* dual interface */ CustomLabels;
struct __declspec(uuid("00020915-0000-0000-c000-000000000046"))
/* dual interface */ CustomLabel;
struct __declspec(uuid("00020914-0000-0000-c000-000000000046"))
/* dual interface */ TablesOfContents;
struct __declspec(uuid("00020913-0000-0000-c000-000000000046"))
/* dual interface */ TableOfContents;
struct __declspec(uuid("00020912-0000-0000-c000-000000000046"))
/* dual interface */ TablesOfAuthorities;
struct __declspec(uuid("00020911-0000-0000-c000-000000000046"))
/* dual interface */ TableOfAuthorities;
struct __declspec(uuid("00020910-0000-0000-c000-000000000046"))
/* dual interface */ Dialogs;
struct __declspec(uuid("000209b8-0000-0000-c000-000000000046"))
/* dual interface */ Dialog;
struct __declspec(uuid("00020971-0000-0000-c000-000000000046"))
/* dual interface */ PageSetup;
struct __declspec(uuid("00020972-0000-0000-c000-000000000046"))
/* dual interface */ LineNumbering;
struct __declspec(uuid("00020973-0000-0000-c000-000000000046"))
/* dual interface */ TextColumns;
struct __declspec(uuid("00020974-0000-0000-c000-000000000046"))
/* dual interface */ TextColumn;
struct __declspec(uuid("00020975-0000-0000-c000-000000000046"))
/* dual interface */ Selection;
struct __declspec(uuid("00020976-0000-0000-c000-000000000046"))
/* dual interface */ TablesOfAuthoritiesCategories;
struct __declspec(uuid("00020977-0000-0000-c000-000000000046"))
/* dual interface */ TableOfAuthoritiesCategory;
struct __declspec(uuid("00020978-0000-0000-c000-000000000046"))
/* dual interface */ CaptionLabels;
struct __declspec(uuid("00020979-0000-0000-c000-000000000046"))
/* dual interface */ CaptionLabel;
struct __declspec(uuid("0002097a-0000-0000-c000-000000000046"))
/* dual interface */ AutoCaptions;
struct __declspec(uuid("0002097b-0000-0000-c000-000000000046"))
/* dual interface */ AutoCaption;
struct __declspec(uuid("0002097c-0000-0000-c000-000000000046"))
/* dual interface */ Indexes;
struct __declspec(uuid("0002097d-0000-0000-c000-000000000046"))
/* dual interface */ Index;
struct __declspec(uuid("0002097e-0000-0000-c000-000000000046"))
/* dual interface */ AddIn;
struct __declspec(uuid("0002097f-0000-0000-c000-000000000046"))
/* dual interface */ AddIns;
struct __declspec(uuid("00020980-0000-0000-c000-000000000046"))
/* dual interface */ Revisions;
struct __declspec(uuid("00020981-0000-0000-c000-000000000046"))
/* dual interface */ Revision;
struct __declspec(uuid("00020982-0000-0000-c000-000000000046"))
/* dual interface */ Task;
struct __declspec(uuid("00020983-0000-0000-c000-000000000046"))
/* dual interface */ Tasks;
struct __declspec(uuid("00020984-0000-0000-c000-000000000046"))
/* dual interface */ HeadersFooters;
struct __declspec(uuid("00020985-0000-0000-c000-000000000046"))
/* dual interface */ HeaderFooter;
struct __declspec(uuid("00020986-0000-0000-c000-000000000046"))
/* dual interface */ PageNumbers;
struct __declspec(uuid("00020987-0000-0000-c000-000000000046"))
/* dual interface */ PageNumber;
struct __declspec(uuid("00020988-0000-0000-c000-000000000046"))
/* dual interface */ Subdocuments;
struct __declspec(uuid("00020989-0000-0000-c000-000000000046"))
/* dual interface */ Subdocument;
struct __declspec(uuid("0002098a-0000-0000-c000-000000000046"))
/* dual interface */ HeadingStyles;
struct __declspec(uuid("0002098b-0000-0000-c000-000000000046"))
/* dual interface */ HeadingStyle;
struct __declspec(uuid("0002098c-0000-0000-c000-000000000046"))
/* dual interface */ StoryRanges;
struct __declspec(uuid("0002098d-0000-0000-c000-000000000046"))
/* dual interface */ ListLevel;
struct __declspec(uuid("0002098e-0000-0000-c000-000000000046"))
/* dual interface */ ListLevels;
struct __declspec(uuid("0002098f-0000-0000-c000-000000000046"))
/* dual interface */ ListTemplate;
struct __declspec(uuid("00020990-0000-0000-c000-000000000046"))
/* dual interface */ ListTemplates;
struct __declspec(uuid("00020991-0000-0000-c000-000000000046"))
/* dual interface */ ListParagraphs;
struct __declspec(uuid("00020992-0000-0000-c000-000000000046"))
/* dual interface */ List;
struct __declspec(uuid("00020993-0000-0000-c000-000000000046"))
/* dual interface */ Lists;
struct __declspec(uuid("00020994-0000-0000-c000-000000000046"))
/* dual interface */ ListGallery;
struct __declspec(uuid("00020995-0000-0000-c000-000000000046"))
/* dual interface */ ListGalleries;
struct __declspec(uuid("00020996-0000-0000-c000-000000000046"))
/* dual interface */ KeyBindings;
struct __declspec(uuid("00020997-0000-0000-c000-000000000046"))
/* dual interface */ KeysBoundTo;
struct __declspec(uuid("00020998-0000-0000-c000-000000000046"))
/* dual interface */ KeyBinding;
struct __declspec(uuid("00020999-0000-0000-c000-000000000046"))
/* dual interface */ FileConverter;
struct __declspec(uuid("0002099a-0000-0000-c000-000000000046"))
/* dual interface */ FileConverters;
struct __declspec(uuid("0002099b-0000-0000-c000-000000000046"))
/* dual interface */ SynonymInfo;
struct __declspec(uuid("0002099c-0000-0000-c000-000000000046"))
/* dual interface */ Hyperlinks;
struct __declspec(uuid("0002099d-0000-0000-c000-000000000046"))
/* dual interface */ Hyperlink;
struct __declspec(uuid("0002099f-0000-0000-c000-000000000046"))
/* dual interface */ Shapes;
struct __declspec(uuid("000209b5-0000-0000-c000-000000000046"))
/* dual interface */ ShapeRange;
struct __declspec(uuid("000209b6-0000-0000-c000-000000000046"))
/* dual interface */ GroupShapes;
struct __declspec(uuid("000209a0-0000-0000-c000-000000000046"))
/* dual interface */ Shape;
struct __declspec(uuid("000209b2-0000-0000-c000-000000000046"))
/* dual interface */ TextFrame;
struct __declspec(uuid("000209a1-0000-0000-c000-000000000046"))
/* dual interface */ _LetterContent;
struct __declspec(uuid("000209a5-0000-0000-c000-000000000046"))
/* dual interface */ View;
struct __declspec(uuid("000209a6-0000-0000-c000-000000000046"))
/* dual interface */ Zoom;
struct __declspec(uuid("000209a7-0000-0000-c000-000000000046"))
/* dual interface */ Zooms;
struct __declspec(uuid("000209a8-0000-0000-c000-000000000046"))
/* dual interface */ InlineShape;
struct __declspec(uuid("000209a9-0000-0000-c000-000000000046"))
/* dual interface */ InlineShapes;
struct __declspec(uuid("000209aa-0000-0000-c000-000000000046"))
/* dual interface */ SpellingSuggestions;
struct __declspec(uuid("000209ab-0000-0000-c000-000000000046"))
/* dual interface */ SpellingSuggestion;
struct __declspec(uuid("000209ac-0000-0000-c000-000000000046"))
/* dual interface */ Dictionaries;
struct __declspec(uuid("000209e0-0000-0000-c000-000000000046"))
/* dual interface */ HangulHanjaConversionDictionaries;
struct __declspec(uuid("000209ad-0000-0000-c000-000000000046"))
/* dual interface */ Dictionary;
struct __declspec(uuid("000209ae-0000-0000-c000-000000000046"))
/* dual interface */ ReadabilityStatistics;
struct __declspec(uuid("000209af-0000-0000-c000-000000000046"))
/* dual interface */ ReadabilityStatistic;
struct __declspec(uuid("000209b3-0000-0000-c000-000000000046"))
/* dual interface */ Versions;
struct __declspec(uuid("000209b4-0000-0000-c000-000000000046"))
/* dual interface */ Version;
struct __declspec(uuid("000209b7-0000-0000-c000-000000000046"))
/* dual interface */ Options;
struct __declspec(uuid("000209ba-0000-0000-c000-000000000046"))
/* dual interface */ MailMessage;
struct __declspec(uuid("000209bb-0000-0000-c000-000000000046"))
/* dual interface */ ProofreadingErrors;
struct __declspec(uuid("000209bd-0000-0000-c000-000000000046"))
/* dual interface */ Mailer;
struct __declspec(uuid("000209c3-0000-0000-c000-000000000046"))
/* dual interface */ WrapFormat;
struct __declspec(uuid("000209d1-0000-0000-c000-000000000046"))
/* dual interface */ HangulAndAlphabetExceptions;
struct __declspec(uuid("000209d2-0000-0000-c000-000000000046"))
/* dual interface */ HangulAndAlphabetException;
struct __declspec(uuid("000209c4-0000-0000-c000-000000000046"))
/* dual interface */ Adjustments;
struct __declspec(uuid("000209c5-0000-0000-c000-000000000046"))
/* dual interface */ CalloutFormat;
struct __declspec(uuid("000209c6-0000-0000-c000-000000000046"))
/* dual interface */ ColorFormat;
struct __declspec(uuid("000209c7-0000-0000-c000-000000000046"))
/* dual interface */ ConnectorFormat;
struct __declspec(uuid("000209c8-0000-0000-c000-000000000046"))
/* dual interface */ FillFormat;
struct __declspec(uuid("000209c9-0000-0000-c000-000000000046"))
/* dual interface */ FreeformBuilder;
struct __declspec(uuid("000209ca-0000-0000-c000-000000000046"))
/* dual interface */ LineFormat;
struct __declspec(uuid("000209cb-0000-0000-c000-000000000046"))
/* dual interface */ PictureFormat;
struct __declspec(uuid("000209cc-0000-0000-c000-000000000046"))
/* dual interface */ ShadowFormat;
struct __declspec(uuid("000209cd-0000-0000-c000-000000000046"))
/* dual interface */ ShapeNode;
struct __declspec(uuid("000209ce-0000-0000-c000-000000000046"))
/* dual interface */ ShapeNodes;
struct __declspec(uuid("000209cf-0000-0000-c000-000000000046"))
/* dual interface */ TextEffectFormat;
struct __declspec(uuid("000209d0-0000-0000-c000-000000000046"))
/* dual interface */ ThreeDFormat;
struct __declspec(uuid("000209f7-0000-0000-c000-000000000046"))
/* dispinterface */ ApplicationEvents;
struct /* coclass */ Global;
struct /* coclass */ Application;
struct __declspec(uuid("000209f6-0000-0000-c000-000000000046"))
/* dispinterface */ DocumentEvents;
struct /* coclass */ Document;
struct /* coclass */ Font;
struct /* coclass */ ParagraphFormat;
struct __declspec(uuid("000209f3-0000-0000-c000-000000000046"))
/* dispinterface */ OCXEvents;
struct /* coclass */ OLEControl;
struct /* coclass */ LetterContent;
struct __declspec(uuid("000209f7-0001-0000-c000-000000000046"))
/* dual interface */ IApplicationEvents;
struct __declspec(uuid("000209fe-0001-0000-c000-000000000046"))
/* dual interface */ IApplicationEvents2;
struct __declspec(uuid("000209fe-0000-0000-c000-000000000046"))
/* dispinterface */ ApplicationEvents2;
struct __declspec(uuid("000209d7-0000-0000-c000-000000000046"))
/* dual interface */ EmailAuthor;
struct __declspec(uuid("000209db-0000-0000-c000-000000000046"))
/* dual interface */ EmailOptions;
struct __declspec(uuid("000209dc-0000-0000-c000-000000000046"))
/* dual interface */ EmailSignature;
struct __declspec(uuid("000209dd-0000-0000-c000-000000000046"))
/* dual interface */ Email;
struct __declspec(uuid("000209de-0000-0000-c000-000000000046"))
/* dual interface */ HorizontalLineFormat;
struct __declspec(uuid("000209e2-0000-0000-c000-000000000046"))
/* dual interface */ Frameset;
struct __declspec(uuid("000209e3-0000-0000-c000-000000000046"))
/* dual interface */ DefaultWebOptions;
struct __declspec(uuid("000209e4-0000-0000-c000-000000000046"))
/* dual interface */ WebOptions;
struct __declspec(uuid("000209df-0000-0000-c000-000000000046"))
/* dual interface */ OtherCorrectionsExceptions;
struct __declspec(uuid("000209e1-0000-0000-c000-000000000046"))
/* dual interface */ OtherCorrectionsException;
struct __declspec(uuid("000209e5-0000-0000-c000-000000000046"))
/* dual interface */ EmailSignatureEntries;
struct __declspec(uuid("000209e6-0000-0000-c000-000000000046"))
/* dual interface */ EmailSignatureEntry;
struct __declspec(uuid("000209e7-0000-0000-c000-000000000046"))
/* dual interface */ HTMLDivision;
struct __declspec(uuid("000209e8-0000-0000-c000-000000000046"))
/* dual interface */ HTMLDivisions;
struct __declspec(uuid("000209e9-0000-0000-c000-000000000046"))
/* dual interface */ DiagramNode;
struct __declspec(uuid("000209ea-0000-0000-c000-000000000046"))
/* dual interface */ DiagramNodeChildren;
struct __declspec(uuid("000209eb-0000-0000-c000-000000000046"))
/* dual interface */ DiagramNodes;
struct __declspec(uuid("000209ec-0000-0000-c000-000000000046"))
/* dual interface */ Diagram;
struct __declspec(uuid("b923fde0-f08c-11d3-91b0-00105a0a19fd"))
/* dual interface */ CustomProperty;
struct __declspec(uuid("b923fde1-f08c-11d3-91b0-00105a0a19fd"))
/* dual interface */ CustomProperties;
struct __declspec(uuid("000209ed-0000-0000-c000-000000000046"))
/* dual interface */ SmartTag;
struct __declspec(uuid("000209ee-0000-0000-c000-000000000046"))
/* dual interface */ SmartTags;
struct __declspec(uuid("000209ef-0000-0000-c000-000000000046"))
/* dual interface */ StyleSheet;
struct __declspec(uuid("07b7cc7e-e66c-11d3-9454-00105aa31a08"))
/* dual interface */ StyleSheets;
struct __declspec(uuid("5d311669-ea51-11d3-87cc-00105aa31a34"))
/* dual interface */ MappedDataField;
struct __declspec(uuid("799a6814-ea41-11d3-87cc-00105aa31a34"))
/* dual interface */ MappedDataFields;
struct __declspec(uuid("396f9073-f9fd-11d3-8ea0-0050049a1a01"))
/* dual interface */ CanvasShapes;
struct __declspec(uuid("b7564e97-0519-4c68-b400-3803e7c63242"))
/* dual interface */ TableStyle;
struct __declspec(uuid("1498f56d-ed33-41f9-b37b-ef30e50b08ac"))
/* dual interface */ ConditionalStyle;
struct __declspec(uuid("bea85a24-d7da-4f3d-b58c-ed90fb01d615"))
/* dual interface */ FootnoteOptions;
struct __declspec(uuid("bf043168-f4de-4e7c-b206-741a8b3ef71a"))
/* dual interface */ EndnoteOptions;
struct __declspec(uuid("12dcdc9a-5418-48a3-bbe6-eb57bae275e8"))
/* dual interface */ Reviewers;
struct __declspec(uuid("47cef4ae-dc32-4220-8aa5-19ccc0e6633a"))
/* dual interface */ Reviewer;
struct __declspec(uuid("b9f1a4e2-0d0a-43b7-8495-139e7acbd840"))
/* dual interface */ TaskPane;
struct __declspec(uuid("e6aaec05-e543-4085-ba92-9bf7d2474f5c"))
/* dual interface */ TaskPanes;
struct __declspec(uuid("00020a00-0001-0000-c000-000000000046"))
/* dual interface */ IApplicationEvents3;
struct __declspec(uuid("00020a00-0000-0000-c000-000000000046"))
/* dispinterface */ ApplicationEvents3;
struct __declspec(uuid("dfb6aa6c-1068-420f-969d-01280fcc1630"))
/* dual interface */ SmartTagAction;
struct __declspec(uuid("cde12cd8-767b-4757-8a31-13029a086305"))
/* dual interface */ SmartTagActions;
struct __declspec(uuid("15ebe471-0182-4cce-98d0-b6614d1c32a1"))
/* dual interface */ SmartTagRecognizer;
struct __declspec(uuid("f2b60a10-ded5-46fb-a914-3c6f4ebb6451"))
/* dual interface */ SmartTagRecognizers;
struct __declspec(uuid("5e9a888c-e5dc-4dcb-8308-3c91fb61e6f4"))
/* dual interface */ SmartTagType;
struct __declspec(uuid("db8e3072-e106-4453-8e7c-53056f1d30dc"))
/* dual interface */ SmartTagTypes;
struct __declspec(uuid("ae6ce2f5-b9d3-407d-85a8-0f10c63289a4"))
/* dual interface */ Line;
struct __declspec(uuid("e2e8a400-0615-427d-adcc-cad39ffebd42"))
/* dual interface */ Lines;
struct __declspec(uuid("add4edf3-2f33-4734-9ce6-d476097c5ada"))
/* dual interface */ Rectangle;
struct __declspec(uuid("7d0f7985-68d9-4d93-91cb-8109280e76cc"))
/* dual interface */ Rectangles;
struct __declspec(uuid("79635bf1-bd1d-4b3f-a520-c1106f1aaad8"))
/* dual interface */ Break;
struct __declspec(uuid("16be9309-d708-4322-bb1a-b056f58d17ea"))
/* dual interface */ Breaks;
struct __declspec(uuid("352840a9-af7d-4ca4-87fc-21c68fdab3e4"))
/* dual interface */ Page;
struct __declspec(uuid("91807402-6c6f-47cd-b8fa-c42fee8ee924"))
/* dual interface */ Pages;
struct __declspec(uuid("09760240-0b89-49f7-a79d-479f24723f56"))
/* dual interface */ XMLNode;
struct __declspec(uuid("d36c1f42-7044-4b9e-9ca3-85919454db04"))
/* dual interface */ XMLNodes;
struct __declspec(uuid("fe0971f0-5e60-4985-bcda-95cb0b8e0308"))
/* dual interface */ XMLSchemaReference;
struct __declspec(uuid("356b06ec-4908-42a4-81fc-4b5a51f3483b"))
/* dual interface */ XMLSchemaReferences;
struct __declspec(uuid("a87e00e9-3ac3-4b53-abe3-7379653d0e82"))
/* dual interface */ XMLChildNodeSuggestion;
struct __declspec(uuid("de63b5ac-ca4f-46fe-9184-a5719ab9ed5b"))
/* dual interface */ XMLChildNodeSuggestions;
struct __declspec(uuid("b140a023-4850-4da6-bc5f-cc459c4507bc"))
/* dual interface */ XMLNamespace;
struct __declspec(uuid("656bbed7-e82d-4b0a-8f97-ec742ba11ffa"))
/* dual interface */ XMLNamespaces;
struct __declspec(uuid("e3124493-7d6a-410f-9a48-cc822c033cec"))
/* dual interface */ XSLTransform;
struct __declspec(uuid("c774f5ea-a539-4284-a1be-30aec052d899"))
/* dual interface */ XSLTransforms;
struct __declspec(uuid("aed7e08c-14f0-4f33-921d-4c5353137bf6"))
/* dual interface */ Editors;
struct __declspec(uuid("dd947d72-f33c-4198-9bdf-f86181d05e41"))
/* dual interface */ Editor;
struct __declspec(uuid("00020a01-0001-0000-c000-000000000046"))
/* interface */ IApplicationEvents4;
struct __declspec(uuid("00020a01-0000-0000-c000-000000000046"))
/* dispinterface */ ApplicationEvents4;
struct __declspec(uuid("00020a02-0000-0000-c000-000000000046"))
/* dispinterface */ DocumentEvents2;
struct __declspec(uuid("4a6ae865-199d-4ea3-9f6b-125bd9c40edf"))
/* dual interface */ Source;
struct __declspec(uuid("fa02a26b-6550-45c5-b6f0-80e757cd3482"))
/* dual interface */ Sources;
struct __declspec(uuid("3834f60f-ee8c-455d-a441-d766675d6d3b"))
/* dual interface */ Bibliography;
struct __declspec(uuid("873e774b-926a-4cb1-878d-635a45187595"))
/* dual interface */ OMaths;
struct __declspec(uuid("e4442a83-f623-459c-8e95-8bfb44dcf23a"))
/* dual interface */ OMath;
struct __declspec(uuid("497142a4-16fd-42c6-bc58-15d89345fc21"))
/* dual interface */ OMathFunctions;
struct __declspec(uuid("8245795b-9aed-4943-a16d-e586ed8180d1"))
/* dual interface */ OMathArgs;
struct __declspec(uuid("f1f37152-1db1-4901-ad9a-c740f99464b4"))
/* dual interface */ OMathFunction;
struct __declspec(uuid("f258de05-c41b-4c33-a778-f0d3f98ceeb3"))
/* dual interface */ OMathAcc;
struct __declspec(uuid("f08b45f1-8f23-4156-9d63-1820c0ed229a"))
/* dual interface */ OMathBar;
struct __declspec(uuid("842c37fe-c76f-4b2b-9b60-c408cb5e838e"))
/* dual interface */ OMathBox;
struct __declspec(uuid("2503b6ee-0889-44df-b920-6d6f9659dea3"))
/* dual interface */ OMathBorderBox;
struct __declspec(uuid("c94688a6-a2a7-4133-a26d-726cd569d5f3"))
/* dual interface */ OMathDelim;
struct __declspec(uuid("1f998a61-71c6-44c2-a0f2-1d66169b47cb"))
/* dual interface */ OMathEqArray;
struct __declspec(uuid("50209974-ba32-4a03-8fa6-bac56cc056fd"))
/* dual interface */ OMathFrac;
struct __declspec(uuid("0d951adf-10a6-4c9b-bcd9-0fb8cbad9a87"))
/* dual interface */ OMathFunc;
struct __declspec(uuid("02b17cb4-7d55-4b34-b38b-10381433441f"))
/* dual interface */ OMathGroupChar;
struct __declspec(uuid("74de9576-8e99-4e28-912b-cb30747c60ce"))
/* dual interface */ OMathLimLow;
struct __declspec(uuid("fc9086c6-0287-4997-b2e1-816c334a22f8"))
/* dual interface */ OMathLimUpp;
struct __declspec(uuid("3e061a7e-67ad-4eaa-bc1e-55057d5e596f"))
/* dual interface */ OMathMat;
struct __declspec(uuid("1b426348-607d-433c-9216-c5d2bf0ef31f"))
/* dual interface */ OMathMatRows;
struct __declspec(uuid("efc71f9c-7f42-4cd4-a7a7-970d7a48cd27"))
/* dual interface */ OMathMatCols;
struct __declspec(uuid("5daa8bb6-054e-48f6-beac-eaad02be0cc7"))
/* dual interface */ OMathMatRow;
struct __declspec(uuid("cae36175-3818-4c60-bcbf-0645d51eb33b"))
/* dual interface */ OMathMatCol;
struct __declspec(uuid("cebd4184-4e6d-4fc6-a42d-2142b1b76af5"))
/* dual interface */ OMathNary;
struct __declspec(uuid("db77d541-85c3-42e8-8649-afbd7cf87866"))
/* dual interface */ OMathPhantom;
struct __declspec(uuid("afaf0c0e-8603-40f6-8fd1-42726cac21e3"))
/* dual interface */ OMathScrPre;
struct __declspec(uuid("67a7eec5-285d-4024-b071-bd6b33b88547"))
/* dual interface */ OMathRad;
struct __declspec(uuid("98dfbd12-96cb-4f07-90ea-749ff1d6b89d"))
/* dual interface */ OMathScrSub;
struct __declspec(uuid("dc489ad4-23c4-4f4b-990f-45a51c7c0c4f"))
/* dual interface */ OMathScrSubSup;
struct __declspec(uuid("d0a95726-678a-4b9d-8103-1e2b86735ae7"))
/* dual interface */ OMathScrSup;
struct __declspec(uuid("6f9d1f68-06f7-49ef-8902-185e54eb5e87"))
/* dual interface */ OMathAutoCorrect;
struct __declspec(uuid("18cd5ec8-8b7b-42c8-992a-2a407468642c"))
/* dual interface */ OMathAutoCorrectEntries;
struct __declspec(uuid("d8779f01-4869-4403-b334-d60c5f9c9175"))
/* dual interface */ OMathAutoCorrectEntry;
struct __declspec(uuid("44fee887-6600-41ab-95a5-de33c605116c"))
/* dual interface */ OMathRecognizedFunctions;
struct __declspec(uuid("5c04bd93-2f3f-4668-918d-9738ec901039"))
/* dual interface */ OMathRecognizedFunction;
struct __declspec(uuid("804cd967-f83b-432d-9446-c61a45cfeff0"))
/* dual interface */ ContentControls;
struct __declspec(uuid("ee95afe3-3026-4172-b078-0e79dab5cc3d"))
/* dual interface */ ContentControl;
struct __declspec(uuid("0c1fabe7-f737-406f-9ca3-b07661f9d1a2"))
/* dual interface */ XMLMapping;
struct __declspec(uuid("54f46dc4-f6a6-48cc-bd66-46c1ddeadd22"))
/* dual interface */ ContentControlListEntries;
struct __declspec(uuid("0c6fa8ca-e65f-4fc7-ab8f-20729eecbb14"))
/* dual interface */ ContentControlListEntry;
struct __declspec(uuid("b5828b50-0e3d-448a-962d-a40702a5868d"))
/* dual interface */ BuildingBlockTypes;
struct __declspec(uuid("817f99fa-ccc4-4971-8e9d-1238f735aaff"))
/* dual interface */ BuildingBlockType;
struct __declspec(uuid("6e47678b-a879-4e56-8698-3b7cf169fad4"))
/* dual interface */ Categories;
struct __declspec(uuid("ecfbdb5e-acd2-4530-ad79-4560b7ff055c"))
/* dual interface */ Category;
struct __declspec(uuid("c6d50987-25d7-408a-bff2-90bf86a24e93"))
/* dual interface */ BuildingBlocks;
struct __declspec(uuid("bfd3fc23-f763-4ff8-826e-1afbf598a4e7"))
/* dual interface */ BuildingBlock;
struct __declspec(uuid("39709229-56a0-4e29-9112-b31dd067ebfd"))
/* dual interface */ BuildingBlockEntries;
struct __declspec(uuid("e2e0f3a7-204c-40c5-baa5-290f374fdf5a"))
/* dual interface */ OMathBreaks;
struct __declspec(uuid("65e515d5-f50b-4951-8f38-fa6ac8707387"))
/* dual interface */ OMathBreak;
struct __declspec(uuid("e6aaec05-e543-4085-ba92-9bf7d2474f51"))
/* dual interface */ Research;
struct __declspec(uuid("d040daf9-6ce4-4be8-839d-f4538a4301cf"))
/* dual interface */ SoftEdgeFormat;
struct __declspec(uuid("f1b14f40-5c32-4c8c-b5b2-de537bb6b89d"))
/* dual interface */ GlowFormat;
struct __declspec(uuid("f01943ff-1985-445e-8602-8fb8f39cca75"))
/* dual interface */ ReflectionFormat;

这些 GUID,你都需要从这正确的机器上复制过来,手动编写也行,但是注册表导入的话,会比较快。我以 _Application 接口为例,它的注册表项应该为:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Wow6432Node\Interface\{00020970-0000-0000-C000-000000000046}]
@="_Application"

[HKEY_CLASSES_ROOT\Wow6432Node\Interface\{00020970-0000-0000-C000-000000000046}\ProxyStubClsid]
@="{00020424-0000-0000-C000-000000000046}"

[HKEY_CLASSES_ROOT\Wow6432Node\Interface\{00020970-0000-0000-C000-000000000046}\ProxyStubClsid32]
@="{00020424-0000-0000-C000-000000000046}"

[HKEY_CLASSES_ROOT\Wow6432Node\Interface\{00020970-0000-0000-C000-000000000046}\TypeLib]
@="{00020905-0000-0000-C000-000000000046}"
"Version"="8.5"


或者(64位 Office):

 

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Interface\{00020970-0000-0000-C000-000000000046}]
@="_Application"

[HKEY_CLASSES_ROOT\Interface\{00020970-0000-0000-C000-000000000046}\ProxyStubClsid]
@="{00020424-0000-0000-C000-000000000046}"

[HKEY_CLASSES_ROOT\Interface\{00020970-0000-0000-C000-000000000046}\ProxyStubClsid32]
@="{00020424-0000-0000-C000-000000000046}"

[HKEY_CLASSES_ROOT\Interface\{00020970-0000-0000-C000-000000000046}\TypeLib]
@="{00020905-0000-0000-C000-000000000046}"
"Version"="8.5"


 

Launcher | 园豆:45050 (高人七级) | 2015-07-21 18:05

@Jehuty': 最后,你还需要去正常的机器上的注册表里把 HKEY_CLASSES_ROOT\Word.XXX 都给复制过来。

Launcher | 园豆:45050 (高人七级) | 2015-07-21 18:12

@Launcher: 好繁琐,我等会去机房把服务器上的office卸载重装一下,还不行就换组件吧,太折腾了。谢谢!!

Jehuty' | 园豆:79 (初学一级) | 2015-07-22 09:17

@Jehuty': 卸载,清理 Office 注册表,然后重装。但是,不一定行哦!因为你安装过 WPS 。所以重装后,如果还是出错,你还是要检查下相关的注册表项是否都存在,不存在的给添加上。

Launcher | 园豆:45050 (高人七级) | 2015-07-22 14:08
其他回答(5)
0

你连报啥错都不说的,不如去找跳大神的,找什么大神啊。

爱编程的大叔 | 园豆:30844 (高人七级) | 2015-07-21 16:45

System.Runtime.InteropServices.COMException (0x80029C4A): 加载类型库/DLL 时出错。 (异常来自 HRESULT:0x80029C4A (TYPE_E_CANTLOADLIBRARY))

支持(0) 反对(0) Jehuty' | 园豆:79 (初学一级) | 2015-07-21 16:49

@Jehuty': 大神已经在回答你了,我就不掺和了。

不过一般的建议是不要用OFFICE这个,而是使用其他第三方组件实现。

支持(0) 反对(0) 爱编程的大叔 | 园豆:30844 (高人七级) | 2015-07-21 17:15

@爱编程的大叔: 第三方组件要收费啊,npoi对excel支持比较好吧,word感觉不是很好用,还有没有其他第三方组件推荐下的

支持(0) 反对(0) Jehuty' | 园豆:79 (初学一级) | 2015-07-21 17:20

@Jehuty': aspose.word非常好。爱编程的大叔这人不推荐,我推荐。

支持(0) 反对(0) lucika.zh | 园豆:54 (初学一级) | 2015-07-21 17:23

@lucika.zh: 这个应该是要收费的吧

支持(0) 反对(0) Jehuty' | 园豆:79 (初学一级) | 2015-07-21 17:28

@Jehuty': 一直免费使用中。什么也没做。

支持(0) 反对(0) lucika.zh | 园豆:54 (初学一级) | 2015-07-21 17:29

@lucika.zh: ASPOSE.WORD的Developer Small Business License 只卖999刀,折成人民币大约是6K.

关键得看题主的应用情况,对于WORD文档生成的要求有多高,这个要题主自行测试才知道了。

要是考虑License的公司,感觉也不差这两个钱,要是不考虑License的公司,那就更加没有问题了。

 

至于NPOI,你看看这个

C# WebForm 使用NPOI 2 生成简单的word文档(.docx)

支持(0) 反对(0) 爱编程的大叔 | 园豆:30844 (高人七级) | 2015-07-21 17:32
0

建议使用其他开源组件,方便、灵活。如aspose.word,不需要word环境。

lucika.zh | 园豆:54 (初学一级) | 2015-07-21 17:22
0

换组件吧,懒得折腾。

幻天芒 | 园豆:37205 (高人七级) | 2015-07-21 17:48
0

建议用 Docx.dll 这个开源的组件,不用安装 office, 很容易方便地操作 word 文档:http://docx.codeplex.com/

Grissom007 | 园豆:215 (菜鸟二级) | 2015-07-23 18:46
0

国内也有相关组件Spire.Doc,可以满足你的需求,不需要word环境,创建Word文档 https://www.e-iceblue.cn/document/set-up-new-word-document.html

UnSoleil | 园豆:228 (菜鸟二级) | 2022-09-16 11:42
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册