Office Development (Visio Object) under. net)

Source: Internet
Author: User

In my opinion, the most important thing for the development and application of these offices is to understand the concept of objects. Whether it's Excel or Visio, there are others. In the office family, all these are COM objects, for. Net calls. Just like the class library that. Net exposes to us, COM objects are also made public to us during external calls, but comments are missing. Although there is no comment, there are user manuals in the corresponding SDK. It should be msdn. Of course, many of them are in English. In fact, this is a very important query material. If the English is not good, I am not good, so I usually go to the Internet to find the Chinese version D VBA manual, all of which are the same COM Object. Although the language is not used, the internal mechanism is the same, so you can understand VBA.

To use a COM object, you must call the property methods in the object. Like. net, they are all object-based. To call a PPT object, we first need to call the application object corresponding to the COM object, and then find the text area object and image area object we want to use. Excel cell objects, Visio shape objects, the main objects we finally want to operate will be displayed in front of us.

To operate these objects, you must first obtain them, that is, location differentiation. The ID of the object is the best identifier, so I will not say much about the ID attribute. It is confusing to say more .. Almost every object in the net class library has IDs, text boxes, buttons, and so on. Although we can change their IDs during design, they are read-only at runtime. As you can imagine, if the identity of the object is determined, someone suddenly changes the name, and an extra pair of twins will not be able to perform subsequent operations. We all need to know where the object we want to operate is.

Here I want to talk about a ppt (DEMO) that I made earlier. In that demo, I didn't use the ID when I got the object, however, you can still separate these objects for operations. But the best way is through their ID. As for how to obtain their ID, ifProgramCan not be obtained, then we can also learn through the program. The ID attribute is included in what is disclosed to us through COM. net to get them (if you want to get the Object ID in the template object, since the template has been created, the subsequent changes will not be very large. The ID obtained by the program can be written as a configuration file. If there is a change, we only need to modify the configuration file ). Objects in the PPT have never known how to view the ID in the program. The shape objects of Visio can be easily viewed in the program.

No matter how you differentiate objects for operations, you only need to achieve the project requirements, but we often need to find the most appropriate solution, because there are often changes.

I found that I mentioned Visio later,CodeIt will not be pasted. There are still a lot of online Visio operations, which can reduce the time to query the VBA manual. Here are some ofArticleIt is very helpful for common projects. If you have relatively biased requirements, you can only find your own manual. Multi-debugging.

Http://www.zxbc.cn/html/20080602/55993.html

A series of articles by http://www.cnblogs.com/xenogear/articles/31515.html#1552550's predecessors

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.