Create my blog Sidebar--word 2007 advanced Applications
I don't know how I can do that, but now with VSTO, you can use the techniques of Windows Forms that you've learned before, and in fact, such a sidebar is a user control. Now, let's develop the "my Blog" sidebar. First, add a user control named Myblogsusercontrol to the project, and then drag and drop the column control over it:
Cbxblogs: For displaying a list of blogs
Btnviewblog: Open the home page of the selected blog in Internet Explorer
Lbxrecentposts: List the most recently posted posts for selected blogs
Btnviewpost: Open a page of selected posts in Internet Explorer
Lbxdrafts: Lists posts that are not posted locally
Btnopendraft: Opens selected post drafts in Word 2007
Myblogsusercontrol is designed in Visual Studio as shown in the following illustration:
Figure 1
The next step is to embed the Myblogsusercontrol into Word 2007, and the easiest way to do that is to load the control in a custom Task pane when the plug-in is started. Back to ThisAddIn.cs, we can see that Visual studio has handler the event for the startup event for our plug-in:
[Ad: Create my blog sidebar &m ...]
So, we just need to insert the following code inside the method:
As an extension of the application level (Application-level), Office 2007 introduced the concept of custom task pane, however, using the custom task pane directly through Office PIAs was cumbersome, so VSTO provides a simplified solution, just as the code #02所示的那样.
Value-added service Area
Creating Custom Task Panes Using Visual Studio Tools for Office,robert Green
Creating Custom Task Panes in the 2007 Office System,mark O ' Hara and Frank Rice
Of course, don't forget to refer to the VSTO namespace:
Test mental Area
How many usages are there in the Using keyword? What are they, respectively?
Now look at the effect of the operation:
Figure 2
So far, the "my Blog" sidebar is just an "empty shell", and the next step is to implement the logic inside.
The next chapter will introduce you to populate my blog sidebar