It was a weekend. When I got home, my parents were prepared and happy. But Yuki was still very busy. It turned out to be a very tedious job, organizing a 1600-row Excel table into Word documents, ft. Isn't that a waste? It takes more than 10 hours every 30 seconds. What is this? To reduce the workload, let me tell you this.
So I made a program based on this. 1. Import the Excel table into the database; 2. Read the Excel table data and write each entry
, to note that the specific method is as follows:The operation process has a certain risk, all first of all to have this kind of permission, add the permission method in the Web. Config add permissions Kill Process Method1Publicstaticvoid KillProcess (stringprocessName)2 {3System. Diagnostics.process MyProc =NewSystem. Diagnostics.process ();//get all the open processes4 5 Try 6 {7 8 foreach(Process ThisprocinchProcess.getprocessesbyname (processName))9 Ten{if(!Thisproc. CloseMainWindow
Recently, I was busy with my work. The Counselor asked me to write a scholarship evaluation form. The result was not completed until the last night. After writing the form, I was prepared to send it to the teacher. However, when I open another check, I cannot open it. "Microsoft Office Word has stopped working". For example
Baidu later found the problem caused by the template file "normal. Dot" and learned
, omissing); MyButton.Caption = "My Custom Button"; MyButton.Style = MsoButtonStyle.msoButtonCaption; } // The following items are optional, but recommended. //The Tag property lets you quickly find the control //and helps MSO keep track of it when more than //one application window is visible. The property is required //by some Office applications and should be provided. MyButton.Tag = "My Custom Button"; // The OnAction
is optional but recommended. // It shoshould be set to the progid of the add-in, so that if // the add-in is not loaded when a user presses the button, // MSO loads the add-in automatically and then raises // The click event for the add-in to handle. mybut Ton. onaction = "!
9.
Generate and test the com external program. To do this, follow these steps:
A.
On the Generate menu, click Generat
the com external program generation process.
B.
Start an office application (for example, Microsoft Word or Microsoft Excel) of the Host application you selected as an external program ).
C.
After the external program is startedOnstartupcompleteEvent, you will receive a message box. Close the message box. N
C # office programming -- word Error Type: "Microsoft. Office. InterOP. Word cannot be found"
Today, I used C # To write an application such as searching for the specified text in word. The compilation result is incorrect:"Cocould not load file or assembly 'Microsoft.
Other referencesHttp://www.vckbase.com/document/viewdoc? Id = 1749Use vc6.0 to compile the word plug-in (office2007)Http://www.vckbase.com/document/viewdoc? Id = 1737Write the word plug-in with vc6.0 (office2k, XP, 03)Bytes ------------------------------------------------------------------------------------The above is reproduced by myselfThe following is an article by zdnet China.
Implement the
Author: useresu download source code
SummaryThis article introduces a simple com plug-in (addin) that uses VC ++ ATL (Active Template Library) and idtextensibility2 to add a simple function to Microsoft Word ), add the toolbar buttons, menus, and other visual components, and add the Event Response Method to them. Finally, the method for mixed programming with office
machine.
Well, I browsed the test from the IIS on the server and threw out the same error as on my machine. It's great. Now I can configure the DCOM permission by my trainer and open the component service dumb.
On the server, windows2008 + iis7.0, no word is found in the DCOM configuration. Check whether the Office is installed. The result is that it is installed, office2007, and search for the post window
In very many enterprise applications, it involves converting office images to PDFs for saving or publishing, because documents in PDF format facilitate encryption and permission control (similar to Baidu Library). Sum up now convert Office files toThere are two main ways to PDF:1. Use Jcob to call MS Office's COM components to convert
1. IntroductionJacob is the abbreviation for Java-com Bridge, which builds a bridge between Java and Microsoft's COM components. Using Jacob's own DLL dynamic link library, and through the way of JNI implementation of the Java platform on the COM program calls. As for what is COM component, let's own Google.2. Installa
memory (automated loading of plug-ins can be done automatically when the program starts).
2. OnDisconnection: Handling when unloading the plug-in from memory.
3. onaddinsupdate:com plug-in changes when processing.
4. OnStartupComplete: When the application starts, the plug-in is processed when it is just loaded.
5. OnBeginShutdown: When the application shuts down, the plug-in is processed when the unloading is complete.
Registering Plug-ins
It can be loaded by its application only if the
Summary
This article describes the use of VC + + ATL (Active Template Library), using the IDTExtensibility2 interface to add a simple COM plug-in (addin) to Microsoft Word, Adding visual parts, such as toolbar buttons and menus, and adding a way to respond to events, and at the end of the paper, provides a simple way to implement a hybrid programming with Office
7. Add menus and buttons to the plug-in:
Here is a brief introduction to the office command bar: in office, the menu bar, toolbar, and pop-up menu are all called command bar objects ). All these types of command lines can contain other command lines and unlimited controls. For example, a button is its control relative to the command bar on the toolbar. Some controls (such as menus) are command lines and ca
8. Add a response event for the button I just added:
ATL provides two template classes for the idispatch interface of the COM Object: idispeventimpl
Class atl_no_vtable caddin:Public ccomobjectrootex .....
Public idispeventsimpleimpl __ Uuidof (Office: _ commandbarbuttonevents>The callback function of the event when the declaration button is clicked:
Void _ stdcall onclickbutton (idispatch */*
Server environment:The environment for the win2008 R2 system is 64 bits, and the program is a C # WinForm. Because the data needs to be processed, and the final generation of Excel, it takes too long to use multithreading. The WinForm program is started by a scheduled task and runs every night.Demand:Daily need to generate a large number of Excel to the user, about 1w+ Excel needs to produce, the original use of Aspose.Cells.dll generated, but found that there is always a lot of Excel inexplicab
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 t
Microsoft Office Excel cannot access files or com, Microsoft Office Excel cannot access files "*. xls ". Possible causes: 1. The file name or path does not exist. 2 files are being used by other programs. 3. The workbook you want to save has the same name as the one currently opened.
An inexplicable error occurs. debugging on the local machine is normal, but once
When ASP. NET operates Word documents,This problem occurs, and word is not installed on the machine,
"Word 2003" is installed in the system, but it is not installed in GAC. (About GAC globalProgramFor details about the set cache, refer to the msdn help .)
First of all, if the problem occurs due to the first reason, it is best to solve the problem, that is, in
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.