[Vsto series] II. Simple UI design/QQ contact Export (on)

Source: Internet
Author: User
Tags export contacts

Last article: http://www.cnblogs.com/longqi293/archive/2010/12/08/vstoforexcel1.html

In daily life, QQ is already an important link connecting us with interpersonal relationships, just like our mobile phones, there are many contacts in mobile phones, and now we provide a lot of software to back up contacts for mobile phones on different platforms, but what about QQ? Apart from members, it seems that it is troublesome to export a contact for backup. Here, we useArticle, To provide a relatively "far-fetched" solution, mainly for non-QQ member friends.

Of course, this article mainly aims to introduce vsto for Excel technology. Maybe this example is not very appropriate. Please forgive me for it. After all, there are many things in Rome ......

Back to today's topic, let's take a closer look at the powerful features vsto offers.

What is ribbon??

Ribbon UI has been widely used since Office 2007.

Ribbon UI history

Ribbon mainly comes from previous Office components. At that time, because the original interface was outdated and users complained that they could not find the required functions. Therefore, Microsoft seeks to use various methods to replace the traditional menu-based and toolbar-based interfaces. After a lot of testsProgramThe staff found the Ribbon interface we are now familiar.

Ribbon profiling

Ribbon menus and buttons are mainly concentrated at the top of the program and displayed in the form of tabs and categories. The function layout is organized. Some buttons are hidden at ordinary times. They are automatically displayed only when necessary. In addition, according to Microsoft, ribbon has made optimizations for the 1024x768 resolution. The previous Alt + F key combination method is still valid.

 

 

For our add-inAdd RIBBON--

We can see that the created add-in project only hasCodeFile. To add the ribbonui interface, right-click the project and use the "add windows form" function to add the page, for example:

After adding a new form, double-click the newly added file to open the UI.

Haha, are you familiar with this? By the way, this is the UI used by our add-in plug-in. We can design ribbon like a desktop program, the specific content will not be described here. You can study it on your own and it is easier to get started.

Start our vstoCode Design --

In our addin program, we write the logic code under the "function button". The main logic code is as follows:

 

Code

     Private    Void  Button#click (  Object  Sender, ribboncontroleventargs E)
{
Excel. worksheet activeworksheet = (Excel. worksheet) globals. thisaddin. application. activesheet;

Foreach (Excel. Range RNG In Activeworksheet. get_range ( " A1: A3 " , Type. Missing ))
{
MessageBox. Show (RNG. value2.tostring ());
}
}

 

It's easy to read. If you are not familiar with the keywords range, Excel, and activesheet, I suggest you go back to the previous article and check the content of the Excel object model, I believe I can quickly recall the http://www.cnblogs.com/longqi293/archive/2010/12/08/vstoforexcel1.html

 

Here, our code mainly completes one thing, that is, when the user clicks the function button, we will display the content from cell A1 to cell A3. Is the result as we said? After debugging, the results can indeed be achieved. Now, we are halfway through the road today. To review:

1. We know how to add ribbonui for the add-in project.

2. Get the cell content of a region using code

Next, let's jump out of the technology circle and look at QQ contacts.

How to export contacts?

This is a problem. There are a wide variety of methods for Members to skip ...... Here I will provide an idea. QQ mail must have been used by everyone. He has a synchronization contact function, and finally an export contact function. I am very excited.

After the test, the exported Excel file for the QQ mail contact contains the mailbox number of all my QQ contacts. It is just that the mailbox number of all of you is basically the account name made of the QQ number ......

Well, here, let's write this article. I am selling a customs token for the time being (in fact, my work is too busy and I can't finish writing it. Sorry ......)

in the next article, we will work with you to implement the contact handling function. Thank you. If you have provided an export and import tool for any contacts, you can find that this function is so troublesome if you do not pay several membership fees for the contact ...... Free and easy-to-use tools ............

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.