我需要在Windows x64系统上使用32位应用程序的IFilter接口。这对于.doc文件来说很容易,因为offfilt.dll支持这两种构建类型。但是,我还需要从.docx和其他类型的文件中获取纯文本。首先的解决方案是安装Microsoft Filter Pack。但是,只有x64版本才会安装。。。这意味着我的32位应用程序无法使用它们。它们在32位Windows下运行良好。
有人找到办法绕过这个吗?
我找到了一种在64位操作系统中安装32位docx Filter Pack的方法。与其他文件格式类似。
- 在32位操作系统中安装Filter Pack 32位
- 将ifilters文件复制到目录"C:\Program Files\Common Files\Microsoft Shared\ Filters"从32位操作系统到a目录"C:\Program Files(x86)\Common64bits操作系统中的"Files\Microsoft Shared\ Filters"
- 将以下行复制到文件"ifilter.reg"并执行该文件:
文件内容:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT.docxPersistentHandler]
@="{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}"
[HKEY_CLASSES_ROOT.docmPersistentHandler]
@="{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}"
[HKEY_CLASSES_ROOT.dotxPersistentHandler]
@="{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}"
[HKEY_LOCAL_MACHINESOFTWAREClasses.docmPersistentHandler]
@="{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}"
[HKEY_LOCAL_MACHINESOFTWAREClasses.docxPersistentHandler]
@="{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}"
[HKEY_LOCAL_MACHINESOFTWAREClasses.dotxPersistentHandler]
@="{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}"
[HKEY_CLASSES_ROOTWow6432NodeCLSID{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}]
@="Office Open XML Format Word Persistent Handler"
[HKEY_CLASSES_ROOTWow6432NodeCLSID{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}PersistentAddinsRegistered]
[HKEY_CLASSES_ROOTWow6432NodeCLSID{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}PersistentAddinsRegistered{89BCB740-6119-101A-BCB7-00DD010655AF}]
@="{5A98B233-3C59-4B31-944C-0E560D85E6C3}"
[HKEY_LOCAL_MACHINESOFTWAREWow6432NodeClassesCLSID{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}]
@="Office Open XML Format Word Persistent Handler"
[HKEY_LOCAL_MACHINESOFTWAREWow6432NodeClassesCLSID{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}PersistentAddinsRegistered]
[HKEY_LOCAL_MACHINESOFTWAREWow6432NodeClassesCLSID{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}PersistentAddinsRegistered{89BCB740-6119-101A-BCB7-00DD010655AF}]
@="{5A98B233-3C59-4B31-944C-0E560D85E6C3}"
[HKEY_CLASSES_ROOTWow6432NodeCLSID{5A98B233-3C59-4B31-944C-0E560D85E6C3}InprocServer32]
@="C:\Program Files (x86)\Common Files\microsoft shared\Filters\offfiltx.dll"
"ThreadingModel"="Both"
[HKEY_LOCAL_MACHINESOFTWAREWow6432NodeClassesCLSID{5A98B233-3C59-4B31-944C-0E560D85E6C3}InprocServer32]
@="C:\Program Files (x86)\Common Files\microsoft shared\Filters\offfiltx.dll"
"ThreadingModel"="Both"
[HKEY_LOCAL_MACHINESOFTWAREWow6432NodeClassesCLSID{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}PersistentAddinsRegistered{89BCB740-6119-101A-BCB7-00DD010655AF}]
@="{5A98B233-3C59-4B31-944C-0E560D85E6C3}"
使用windows注册表脚本扩展Rui answer的3种文件格式(Word、Excel、PowerPoint)。希望,对某人来说是安全的时间,因为它运行良好:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT.docxPersistentHandler]
@="{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}"
[HKEY_CLASSES_ROOT.pptxPersistentHandler]
@="{4F46F75F-199F-4C63-8B7D-86D48FE7970C}"
[HKEY_CLASSES_ROOT.xlsxPersistentHandler]
@="{4887767F-7ADC-4983-B576-88FB643D6F79}"
[HKEY_CLASSES_ROOT.docmPersistentHandler]
@="{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}"
[HKEY_CLASSES_ROOT.pptmPersistentHandler]
@="{4F46F75F-199F-4C63-8B7D-86D48FE7970C}"
[HKEY_CLASSES_ROOT.xlsmPersistentHandler]
@="{4887767F-7ADC-4983-B576-88FB643D6F79}"
[HKEY_CLASSES_ROOT.dotxPersistentHandler]
@="{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}"
[HKEY_LOCAL_MACHINESOFTWAREClasses.docmPersistentHandler]
@="{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}"
[HKEY_LOCAL_MACHINESOFTWAREClasses.docxPersistentHandler]
@="{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}"
[HKEY_LOCAL_MACHINESOFTWAREClasses.pptmPersistentHandler]
@="{4F46F75F-199F-4C63-8B7D-86D48FE7970C}"
[HKEY_LOCAL_MACHINESOFTWAREClasses.pptxPersistentHandler]
@="{4F46F75F-199F-4C63-8B7D-86D48FE7970C}"
[HKEY_LOCAL_MACHINESOFTWAREClasses.xlsmPersistentHandler]
@="{4887767F-7ADC-4983-B576-88FB643D6F79}"
[HKEY_LOCAL_MACHINESOFTWAREClasses.xlsxPersistentHandler]
@="{4887767F-7ADC-4983-B576-88FB643D6F79}"
[HKEY_LOCAL_MACHINESOFTWAREClasses.dotxPersistentHandler]
@="{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}"
[HKEY_CLASSES_ROOTWow6432NodeCLSID{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}]
@="Office Open XML Format Word Persistent Handler"
[HKEY_CLASSES_ROOTWow6432NodeCLSID{4F46F75F-199F-4C63-8B7D-86D48FE7970C}]
@="Office Open XML Format PowerPoint Persistent Handler"
[HKEY_CLASSES_ROOTWow6432NodeCLSID{4887767F-7ADC-4983-B576-88FB643D6F79}]
@="Office Open XML Format Excel Persistent Handler"
[HKEY_CLASSES_ROOTWow6432NodeCLSID{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}PersistentAddinsRegistered]
[HKEY_CLASSES_ROOTWow6432NodeCLSID{4F46F75F-199F-4C63-8B7D-86D48FE7970C}PersistentAddinsRegistered]
[HKEY_CLASSES_ROOTWow6432NodeCLSID{4887767F-7ADC-4983-B576-88FB643D6F79}PersistentAddinsRegistered]
[HKEY_CLASSES_ROOTWow6432NodeCLSID{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}PersistentAddinsRegistered{89BCB740-6119-101A-BCB7-00DD010655AF}]
@="{5A98B233-3C59-4B31-944C-0E560D85E6C3}"
[HKEY_CLASSES_ROOTWow6432NodeCLSID{4F46F75F-199F-4C63-8B7D-86D48FE7970C}PersistentAddinsRegistered{89BCB740-6119-101A-BCB7-00DD010655AF}]
@="{DDFE337F-4987-4EC8-BDE3-133FA63D5D85}"
[HKEY_CLASSES_ROOTWow6432NodeCLSID{4887767F-7ADC-4983-B576-88FB643D6F79}PersistentAddinsRegistered{89BCB740-6119-101A-BCB7-00DD010655AF}]
@="{F90DFE0C-CBDF-41FF-8598-EDD8F222A2C8}"
[HKEY_LOCAL_MACHINESOFTWAREWow6432NodeClassesCLSID{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}]
@="Office Open XML Format Word Persistent Handler"
[HKEY_LOCAL_MACHINESOFTWAREWow6432NodeClassesCLSID{4F46F75F-199F-4C63-8B7D-86D48FE7970C}]
@="Office Open XML Format PowerPoint Persistent Handler"
[HKEY_LOCAL_MACHINESOFTWAREWow6432NodeClassesCLSID{4887767F-7ADC-4983-B576-88FB643D6F79}]
@="Office Open XML Format Excel Persistent Handler"
[HKEY_LOCAL_MACHINESOFTWAREWow6432NodeClassesCLSID{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}PersistentAddinsRegistered]
[HKEY_LOCAL_MACHINESOFTWAREWow6432NodeClassesCLSID{4F46F75F-199F-4C63-8B7D-86D48FE7970C}PersistentAddinsRegistered]
[HKEY_LOCAL_MACHINESOFTWAREWow6432NodeClassesCLSID{4887767F-7ADC-4983-B576-88FB643D6F79}PersistentAddinsRegistered]
[HKEY_LOCAL_MACHINESOFTWAREWow6432NodeClassesCLSID{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}PersistentAddinsRegistered{89BCB740-6119-101A-BCB7-00DD010655AF}]
@="{5A98B233-3C59-4B31-944C-0E560D85E6C3}"
[HKEY_LOCAL_MACHINESOFTWAREWow6432NodeClassesCLSID{4F46F75F-199F-4C63-8B7D-86D48FE7970C}PersistentAddinsRegistered{89BCB740-6119-101A-BCB7-00DD010655AF}]
@="{DDFE337F-4987-4EC8-BDE3-133FA63D5D85}"
[HKEY_LOCAL_MACHINESOFTWAREWow6432NodeClassesCLSID{4887767F-7ADC-4983-B576-88FB643D6F79}PersistentAddinsRegistered{89BCB740-6119-101A-BCB7-00DD010655AF}]
@="{F90DFE0C-CBDF-41FF-8598-EDD8F222A2C8}"
[HKEY_CLASSES_ROOTWow6432NodeCLSID{5A98B233-3C59-4B31-944C-0E560D85E6C3}InprocServer32]
@="C:\Program Files (x86)\Common Files\microsoft shared\Filters\offfiltx.dll"
"ThreadingModel"="Both"
[HKEY_CLASSES_ROOTWow6432NodeCLSID{DDFE337F-4987-4EC8-BDE3-133FA63D5D85}InprocServer32]
@="C:\Program Files (x86)\Common Files\microsoft shared\Filters\offfiltx.dll"
"ThreadingModel"="Both"
[HKEY_CLASSES_ROOTWow6432NodeCLSID{4887767F-7ADC-4983-B576-88FB643D6F79}InprocServer32]
@="C:\Program Files (x86)\Common Files\microsoft shared\Filters\offfiltx.dll"
"ThreadingModel"="Both"
[HKEY_LOCAL_MACHINESOFTWAREWow6432NodeClassesCLSID{5A98B233-3C59-4B31-944C-0E560D85E6C3}InprocServer32]
@="C:\Program Files (x86)\Common Files\microsoft shared\Filters\offfiltx.dll"
"ThreadingModel"="Both"
[HKEY_LOCAL_MACHINESOFTWAREWow6432NodeClassesCLSID{DDFE337F-4987-4EC8-BDE3-133FA63D5D85}InprocServer32]
@="C:\Program Files (x86)\Common Files\microsoft shared\Filters\offfiltx.dll"
"ThreadingModel"="Both"
[HKEY_LOCAL_MACHINESOFTWAREWow6432NodeClassesCLSID{F90DFE0C-CBDF-41FF-8598-EDD8F222A2C8}InprocServer32]
@="C:\Program Files (x86)\Common Files\microsoft shared\Filters\offfiltx.dll"
"ThreadingModel"="Both"
[HKEY_LOCAL_MACHINESOFTWAREWow6432NodeClassesCLSID{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}PersistentAddinsRegistered{89BCB740-6119-101A-BCB7-00DD010655AF}]
@="{5A98B233-3C59-4B31-944C-0E560D85E6C3}"
[HKEY_LOCAL_MACHINESOFTWAREWow6432NodeClassesCLSID{4F46F75F-199F-4C63-8B7D-86D48FE7970C}PersistentAddinsRegistered{89BCB740-6119-101A-BCB7-00DD010655AF}]
@="{DDFE337F-4987-4EC8-BDE3-133FA63D5D85}"
[HKEY_LOCAL_MACHINESOFTWAREWow6432NodeClassesCLSID{4F46F75F-199F-4C63-8B7D-86D48FE7970C}PersistentAddinsRegistered{89BCB740-6119-101A-BCB7-00DD010655AF}]
@="{F90DFE0C-CBDF-41FF-8598-EDD8F222A2C8}"
正如您所发现的,在64位系统上没有支持的安装32位过滤器的方法,请参阅本文末尾MSFT的回复:如何在64位的系统上安装32位Office Filter Pack?。
这里建议的解决方案是创建一个助手程序来进行过滤并将数据传递回主应用程序。
有很多方法可以在Windows中进行IPC,所以请选择一种适合您的方法。我创建了一个服务,它使用WCF轻松创建远程代理,使操作对主应用程序非常透明。