如何确定是否安装了 MS Office 2007 SP2?

发布于 2024-08-26 07:51:21 字数 180 浏览 5 评论 0原文

我正在通过 OLE 使用 MS Word 从我的应用程序生成文档。我想让安装了 MS Office 2007 SP2 的用户能够将文档另存为 PDF。该功能仅在 SP2 中可用,如果未安装该服务包,该选项应被隐藏(当然也适用于以前版本的 MS Office 的用户)。

此信息是否可以在任何地方使用,例如在注册表或任何配置文件中?

In am using MS Word via OLE to produce documents from my application. I want to give the users that have MS Office 2007 SP2 installed the ability to save the documents as PDF. This is only available in SP2, and the option should be hidden if the service pack is not installed (and of course also for users of previous versions of MS Office).

Is this information available anywhere, like in the registry or any configuration file?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

所谓喜欢 2024-09-02 07:51:21

找不到任何对您有帮助的内容,但这里有一些您可能会觉得有用的内容。

Office 版本存储在注册表中,

HKEY_LOCAL_MACHINE \Software\Microsoft\Office\12.0\Common\productVersion

对于 Office 2003 和 2007,值 12.0 发生变化。该密钥有一个数字。我想检查这个数字是否有不同的版本(带/不带 SP1/SP2),看看是否有 sia 差异。

Couldn't find anything helpful for you but here is something which you might find useful.

Office version is stored in registry

HKEY_LOCAL_MACHINE \Software\Microsoft\Office\12.0\Common\productVersion

the value 12.0 changes for office 2003 and 2007. This key has a number. I think checking this number for different version (with/without SP1/SP2) and see if there sia difference.

烟火散人牵绊 2024-09-02 07:51:21

有关适用于各个服务包的实际版本信息,请查看此隐藏良好的知识库条目:

http:// /support.microsoft.com/kb/928116

For the actual version infos that apply to the individual service packs have a look at this well hidden kb entry:

http://support.microsoft.com/kb/928116

城歌 2024-09-02 07:51:21

Microsoft 有不同的插件可提供打印为 PDF 功能:

  • 2007 Microsoft Office 插件:Microsoft 另存为 PDF 或 XPS
  • 2007 Microsoft Office 插件:Microsoft 另存为 PDF
  • 2007 Microsoft Office 插件:Microsoft 另存为 XPS (不支持 PDF)

并且 SP2 也会安装这些插件。

我正在寻找一种方法来测试 PDF 功能是否安装。
仅当计算机上安装了 PDF 功能(通过加载项或 SP)时,才会出现以下文件:

C:\Program Files\Common Files\Microsoft Shares\Office12\EXP_PDF.DLL

There are different plugins from Microsoft to provide the print to PDF feature:

  • 2007 Microsoft Office Add-in: Microsoft Save as PDF or XPS
  • 2007 Microsoft Office Add-in: Microsoft Save as PDF
  • 2007 Microsoft Office Add-in: Microsoft Save as XPS (does NOT come with PDF support)

and SP2 installs these Addins too.

I was looking for a way to test if the PDF feature is installed or not.
The following file is only present if the PDF feature is installed (by an add-in or by the SP) on a machine:

C:\Program Files\Common Files\Microsoft Shares\Office12\EXP_PDF.DLL
断念 2024-09-02 07:51:21

该更新安装在以下注册表项中。

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\00002109030000000000000000F01FEC\Patches\6D6C63B08D5FFAE4FB4934672A03DAB5

The update is installed in the following registry key.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\00002109030000000000000000F01FEC\Patches\6D6C63B08D5FFAE4FB4934672A03DAB5

漆黑的白昼 2024-09-02 07:51:21

好吧,这有点晚了,但您可以直接从 VBA 确定服务包,而不必弄乱注册表。显然,当 Microsoft 更新 Office 时,您需要更新它。

使用 Office 不同版本的支持页面,您可以获得内部版本号并使用函数来确定服务包等。Office 2007 显示 Office 中不同应用程序之间的细微差异,因此您必须根据需要进行调整。

那么下面的函数将完成 Excel Office 2007+ 的工作:

Function DetermineExcelServicePack() As String
    Dim sReturn As String

    If Application.Version = "12.0" Then
        If Application.Build < 6214 Then
            sReturn = "Excel 2007, RTM"
        ElseIf Application.Build < 6425 Then
            sReturn = "Excel 2007, SP1"
        ElseIf Application.Build < 6611 Then
            sReturn = "Excel 2007, SP2"
        Else
            sReturn = "Excel 2007, SP3"
        End If
    ElseIf Application.Version = "14.0" Then
        If Application.Build < 6029 Then
            sReturn = "Excel 2010, RTM"
        ElseIf Application.Build < 7015 Then
            sReturn = "Excel 2010, SP1"
        Else
            sReturn = "Excel 2010, SP2"
        End If
    ElseIf Application.Version = "15.0" Then
        sReturn = "Excel 2013, RTM"
    Else
        sReturn = "This version (" & Application.Version & "-" & Application.Build & ") is not supported by this function"
    End If

    DetermineExcelServicePack = sReturn
End Function

Ok, this is a bit late but you can determine the Service pack directly from VBA without having to mess with the registry. Obviously you'd need to update it as Microsoft updates Office.

Using the support pages for the different versions off Office you can get the build number and use a function to determine the service pack etc. Office 2007 shows slight discrepancies between the different applications within office so you'd have to tweak as required.

Then a function as follows will do the job for Excel Office 2007+:

Function DetermineExcelServicePack() As String
    Dim sReturn As String

    If Application.Version = "12.0" Then
        If Application.Build < 6214 Then
            sReturn = "Excel 2007, RTM"
        ElseIf Application.Build < 6425 Then
            sReturn = "Excel 2007, SP1"
        ElseIf Application.Build < 6611 Then
            sReturn = "Excel 2007, SP2"
        Else
            sReturn = "Excel 2007, SP3"
        End If
    ElseIf Application.Version = "14.0" Then
        If Application.Build < 6029 Then
            sReturn = "Excel 2010, RTM"
        ElseIf Application.Build < 7015 Then
            sReturn = "Excel 2010, SP1"
        Else
            sReturn = "Excel 2010, SP2"
        End If
    ElseIf Application.Version = "15.0" Then
        sReturn = "Excel 2013, RTM"
    Else
        sReturn = "This version (" & Application.Version & "-" & Application.Build & ") is not supported by this function"
    End If

    DetermineExcelServicePack = sReturn
End Function
青春如此纠结 2024-09-02 07:51:21

以编程方式检查 MSO.DLL 文件的版本是否大于或等于:

“12.0.6425.1000”

如果安装了 SP2 及更高版本,则这是该文件的值。

Programatically check whether version of the MSO.DLL file is greater than or equal to :

"12.0.6425.1000"

This is the value for the file if SP2 and above is installed.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文