VB.NET
勾吴江南
志异征诛,三让两家王朝;
功同开辟,一桮万古江南。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
在Excel(xlsx)文件中用OpenXml SDK 添加一个新的Worksheet并写入字符串
实现环境:Visual Studio 2010, OpenXml SDK 2.0.5022 这个代码实现了向一个已有的xlsx文件中添加一个新的Worksheet,并在这个Sheet中写入三行字符串“ObjectA1"~"ObjectC5" Imports DocumentFormat.OpenXml.Packaging Imports DocumentFormat.OpenXml.Spr原创 2011-12-19 20:17:57 · 2154 阅读 · 0 评论 -
在Outlook新邮件中向光标所在处插入一段新文字然后光标后移
实现环境:Visual Studio 2010, Outlook 2010, VSTO runtime 4.0 C# using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Office.Tools.Ribbon; using Outlook =原创 2011-12-12 11:17:41 · 3932 阅读 · 2 评论 -
动态生成多个VBE按钮控件并操作它们的属性
实现环境:Visual Studio 2010,Excel 2010, VSTO 4.0 Imports Microsoft.Office.Tools.Ribbon Imports VBE = Microsoft.Vbe.Interop Imports Forms = Microsoft.Vbe.Interop.Forms Public Class Ribbon1 Private原创 2011-12-23 14:39:48 · 1375 阅读 · 0 评论 -
连接Excel数据源并查询
Excel表必须是97-2003格式的。否则无法查询。 Imports System.Data.OleDb Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As _ System.EventArgs) H原创 2012-02-01 19:04:43 · 1397 阅读 · 0 评论 -
如何在一个Office Automation的程序中获取Shared Calendars
Imports Outlook = Microsoft.Office.Interop.Outlook Public Class Form1 Private OLApp As Outlook.Application Private OlExplorer As Outlook.Explorer Private OlNavigationPan As Outlook.Naviga原创 2012-02-24 09:32:21 · 929 阅读 · 0 评论 -
在幻灯片放映过程中动态插入内容
以下示例用来展示在放映幻灯片的过程中动态插入内容。 Public Class ThisAddIn Private WithEvents PPApp As PowerPoint.Application Private Sub ThisAddIn_Startup() Handles Me.Startup PPApp = Application End Sub原创 2012-04-11 10:32:35 · 1241 阅读 · 0 评论 -
Word add-in 通过ConfigurationManager读取configuration文件的方法
在一般的application中我们是这样读取configuration文件的 Dim DBconfig As System.Configuration.Configuration = System.Configuration.ConfigurationManager.OpenExeConfiguration(System.Configuration.ConfigurationUserLev原创 2012-03-26 13:48:12 · 998 阅读 · 0 评论 -
免费的Html转rtf方法
Dim reportWebBrowser As New WebBrowser reportWebBrowser.CreateControl() reportWebBrowser.DocumentText = sbHTMLDoc.ToString While reportWebBrowser.DocumentText <> sbHTMLDoc.ToString原创 2012-04-24 14:48:48 · 2157 阅读 · 0 评论 -
RibbonXml Office 2007与Office 2010在装载上的区别
在实际工作中我注意到在Office 2007中,当RibbonXml装载完成以后私有属性ribbon仍然是存在的,而在Office 2010中ribbon在装载完成以后就被销毁了。原创 2012-05-16 14:16:15 · 795 阅读 · 0 评论 -
VB.NET OpenXml 修改制定Worksheet的特定单元格(外加log4net应用)
app.config %m%n"> %m%n"> Module1.vb Imports System.原创 2012-05-24 13:58:26 · 2173 阅读 · 0 评论 -
在VB.NETxi下调用Access中的Report
在VB.NET中可以用两种方式调用Access数据库:ADO.NET或者自动化(Automation)。 如果你是要操纵Access下的数据那么ADO.NET必然是首选。如果你要操纵Access下的Form,Report就必须使用自动化。 以下是一个示例: 新建一个Window Forms Application.引用”Microsoft.Office.Interop.Access” 1原创 2012-06-20 11:36:37 · 1238 阅读 · 0 评论 -
在Word文档中连继用代码添两个表的方法
【要点】:在Word中添加两个表时中间必须空出一行,否则这两个表会合并成一个表。另外,当用代码添加完第一个表后必须将光标移出表格,否则第二个表格会套嵌在第一个表格中。 以下是代码: Public Class ThisDocument Private Sub ThisDocument_Startup() Handles Me.Startup Dim R1 As原创 2012-10-12 16:36:59 · 1077 阅读 · 0 评论 -
Word文档用代码移除Header
在PIA中Microsoft 似乎没有给出移除Header的方法。在实践中我发现下面代码能做到这一点: Dim wdApp As Word.Application Dim wdDoc As Word.Document Dim wdSection As Word.Section wdApp = Globals.ThisDocument.原创 2012-11-07 12:24:24 · 1206 阅读 · 0 评论 -
在Word 中用C#查找Wingdings符号
在Word我们通常在VBA或VB.NET环境下以如下方式查找Wingdings符号: Dim wdApp As Word.Application = Globals.ThisDocument.Application Dim wdDoc As Word.Document = wdApp.ActiveDocument Dim wdRange As Wo原创 2012-12-31 15:10:31 · 2555 阅读 · 0 评论
分享