Office Pia: deploy office Pia applications

Source: Internet
Author: User
Tags microsoft website

Office Pia-based applicationsProgramThere are several ways to run smoothly on customers' computers:

Method 1: Let the customer install ". Net programmable support" (. NET programmability Support) when installing the office)

Read, not explained:

Method 2: Ask the customer to install office Pia

For example, for Office 2007 Pia, search for "Office 2007 Pia" on the Microsoft website download channel and obtain the following information:

2007 Microsoft Office system update: redistributable primary InterOP assemblies

Http://www.microsoft.com/download/en/details.aspx? Id = 18346

However, the above two methods may cause poor user experience. I want to introduce method 3.

Method 3: deploy necessary DLL files to the program execution directory

First, after installing office Pia on the development machine, we need to know which DLL we all need. Not all DLL files are required.

In my previous example 《Office Pia:CodeExample: Excel app class for generating Excel filesFor example:

The only dll I need is:

    • Microsoft. Office. InterOP. Excel. dll
    • Microsoft. VBE. InterOP. dll
    • Office. dll

Add references to the three DLL files in the Visual Studio Project (that is, the three references marked with red lines ):

Note: If you only Add a reference to Microsoft. Office. InterOP. Excel. dll, You can compile the program successfully. However, to copy the remaining two DLL files to the program execution directory, you must add all the three references.

Then, set the copy local attribute of the three references to true:

In this way, after your program is compiled, these three DLL files are also copied to the program running directory.

Of course, there areMethod 4: deploy related DLL through installation project. I will not go into details.

References:

    • How to: Install office primary InterOP assemblies
      Http://msdn.microsoft.com/en-us/library/kh3965hw%28v=VS.80%29.aspx
    • Installing and using the Office 2003 primary InterOP assemblies

      Http://msdn.microsoft.com/en-us/library/aa159923%28v=office.11%29.aspx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.