C # how to convert the COM component in the office

Source: Internet
Author: User

My computer configuration (Windows Server 2003 + office2003 + visualstudio 2003)

Because some Word documents need to be processed. excel and TXT documents are included in the database. so I found some articles on the Internet about how C # processes office text blocks. there are two important points.

First, the Excel component conversion method:
When I run "tlbimp excel.exe" in DOS, the system prompts that the tlbimp command does not exist.
The command is found below "D:/program files/Microsoft Visual Studio. NET 2003/SDK/V1.1/bin.
C:/program files/Microsoft Office/office11/Excel found in resource manager. copy the EXE file to the Directory D:/program files/Microsoft Visual Studio. NET 2003/SDK/V1.1/bin.
Run "cmd" and run cd d:/program files/Microsoft Visual Studio. NET 2003/SDK/V1.1/bin and then enter tlbimp excel.exe. finally, the Excel file is successfully found. DLL file. The file size is 1064 kb.

The second is to convert the word component method:
When I run "tlbimp excel.exe" in DOS, the system prompts that the tlbimp command does not exist.

1. in resource manager, find "C:/program files/Microsoft Office/office11/winword. EXE "file copy to Directory D:/program files/Microsoft Visual Studio. NET 2003/SDK/V1.1/bin.

2. click Start Menu-run-enter the "cmd" command, and use "cd d:/program files/Microsoft Visual Studio. NET 2003/SDK/V1.1/bin enter the Directory and enter tlbimp winword. EXE. result error. The error message indicates that the type is incorrect.

3. copy "C:/program files/Microsoft Office/office11/MSWord. olb ", go to the directory" ", and then run" tlbimp MSWord. olb. DLL ". the file size is 640 kb.

Third, the access component conversion method:
1. copy "C:/program files/Microsoft Office/office11/msacc. olb ", to the directory" D:/program files/Microsoft Visual Studio. NET 2003/SDK/V1.1/bin,

2. Start Menu-run-enter the "cmd" command and enter the directory with "cd d:/program files/Microsoft Visual Studio. NET 2003/SDK/V1.1/bin ".

3. enter the command "tlbimp msacc. olb, and the result is "ADODB. DLL, Dao. DLL, access. DLL "three files. (If tlbimp msaccess is used. EXE command. will be output with tlbimp winword. the same error of exe. is not a valid type liburary !)

Conclusion: The excel9.0 oolb file is not found after Office2000. The conversion command must be found in the bin folder under the. NET installation directory.

Related Article

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.