- 博客(157)
- 收藏
- 关注
转载 SqlServer死锁与阻塞检测脚本
1 IF EXISTS (SELECT * FROM sysobjects WHERE [name] = 'sp_Lock_Scan') 2 DROP PROCEDURE sp_Lock_Scan 3 GO 4 5 CREATE PROCEDURE sp_Lock_Scan 6 AS 7 DECLARE @SPID INT...
2019-10-08 10:28:29
219
转载 SqlDbType与DbType这间的转换关系
SqlDbType => DbTypeSqlDbType.BigInt DbType.Int64SqlDbType.Binary DbType.BinarySqlDbType.Bit DbType.BooleanSqlDbType.Char DbType.AnsiStringFixedLengthSqlDbType.DateTime ...
2019-10-08 10:28:27
745
转载 How to resolve the SQL error “cannot connect to WMI provider”
当你试图打开SQL Server Configuation Manager时发现如下错误:“cannot connect to WMI provider. You do not have permission or the server is unreachable. Note that you can only manage SQL Server 2005 and later ...
2019-10-08 10:28:25
348
转载 在Excel中创建和使用ServerDocument
ServerDocument是微软提供的一种读取Word或Excel文档级应用中CachedData的工具。本示例将向你展示如何使用用ServerDocument。1.创建文档级应用打开Visual Studio,新建一个Excel Workbook应用2.创建数据模型在类库中,建产一个名为“ContractTabl...
2019-10-08 10:28:25
190
转载 获取Outlook的起始文件夹-VSTO
实现环境:Visual Studio 2010 Uiltmate, Office 2010using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Xml.Linq;using Outlook = Microsoft.Office.I...
2019-10-08 10:28:24
192
转载 在Fedora20上安装Oracle 12c
本文将引导大家在Fedora20的环境下成功安装Oracle12c。安装前的准备编辑/etc/hosts文件,添加本机名称编辑/etc/selinux/config文件编辑/etc/redhat-release做如下查询,以确定要修改的项目sysctl -a | grep fs.file-max...
2019-10-08 10:28:23
137
转载 在控制台程序中Application.Documents.Open方法失效
这个可能跟DCOM的设定有关。请尝试以下步骤去解决它:打开dcomcnfg.exe->Computer->Local Computer->Config DOCOM->搜索Microsoft Word 97-2003 Document->Properties->Identity->把Launching User改为Interac...
2019-10-08 10:28:22
739
转载 Outlook 2010中添加自定义Form并使用VB代码处理事务的示例
在Outlook中用户能在不同层次上定义一些自定义的Form来方便Outlook中的一些具有自己个性的事务的处理。本示例将重现这个开发过程。在开始重现前我们先做如下约定以保证示例能被正确理解:1.你已经熟知Custom Form与Organizational Forms Library(企业窗体),Personal FormsLibrary(个人窗体),O...
2019-10-08 10:28:21
457
转载 Word 刚启动是写在add-in中的NewDocument事件为什么不会被触发
因为NewDocument事件结束在ThisAddIn_Startup方法之前,也就是说在NewDocument事件被订阅之前这个事件就已经执行完毕了。转载于:https://www.cnblogs.com/mksword/archive/2013/02/05/3934012.html...
2019-10-08 10:28:20
166
转载 C#汉字判断的实现
看了http://bbs.youkuaiyun.com/topics/380159364觉得很有意思,在这是做了一些还原。在此与大家分享:/** * 作者:许阳 * 日期:2013年2月28日 * 简述: * */using System;using System.Collections.Generic;using System.Linq;using System....
2019-10-08 10:28:19
135
转载 动态内容控件应用(一)
例程目的:在一个表格中,当选择"None"前的CheckBox后,表格中的其他CheckBox会消失(以防错选)。当取消选择后CheckBox会重新出现。如图:说明:此前必须将"None"前CheckBox的Title设定为"None"。Option ExplicitPrivate Sub Document_ContentControlOnEnter(...
2019-10-08 10:28:18
178
转载 在Excel 中存在两种ListBox
在Excel中存在着Excel.ListBox和MsForms.ListBox两种ListBox。其中Excel.ListBox是隐藏的,你在ObjectView窗体中是不可见的(如果你想看到这个类请在ObjectView窗体上点击右键选择"Show Hidden Members"/”显示隐含成员“)。在Excel的VBA项目中这个隐藏的Excel.ListBox被视为Lis...
2019-10-08 10:28:17
832
转载 Office 2013 PIA 组件的GUID
Primary interop assemblyOffice 2013 Component IDOffice 2013 Component ID [64 bit]Excel{C8A65ABE-3270-4FD7-B854-50C8082C8F39}{E3BD1151-B9CA-4D45-A77E-...
2019-10-08 10:28:16
257
转载 调COM向Sheet1的Range("A1")添加内容
// InsertAfterSheets.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include <Windows.h>HRESULT AutoWrap(int autoType, VARIANT *pvResult, IDispatch...
2019-10-08 10:28:16
563
转载 OpenXml获取被保护Sheet的密码并解除保护
using System;using System.Collections.Generic;using System.Linq;using System.Text;using DocumentFormat.OpenXml.Spreadsheet;using com.mksword.Net.OpenXmlTools;using com.mksword.OpenXmlUt...
2019-10-08 10:28:13
406
转载 Office 2010下VBA Addressof的应用
在VBA中Addressof不能在Class或Form中使用,只有Module模式下才能使用Addressof以面是一个计时器的例子:Form1中代码:Private Declare Function KillTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long) As LongPrivate...
2019-10-08 10:28:12
1143
转载 C#中利用反射操作私有字段与私有方法
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Reflection;namespace ConsoleApplication14{ class Program { static void Ma...
2019-10-08 10:28:11
372
转载 调用COM新建一个空白文档并加入链接
// AddHyperLinkViaCom.cpp : Defines the entry point for the console application.//#include "stdafx.h"HRESULT AutoWrap(int autoType, VARIANT *pvResult, IDispatch *pDisp, LPOLESTR ptName...
2019-10-08 10:28:10
117
转载 在Word 中用C#查找Wingdings符号
在Word我们通常在VBA或VB.NET环境下以如下方式查找Wingdings符号: Dim wdApp As Word.Application = Globals.ThisDocument.Application Dim wdDoc As Word.Document = wdApp.ActiveDocument Dim wdRa...
2019-10-08 10:28:10
382
转载 CLR C++ Set Word CustomDocumentProperties
// WordIssue.cpp : main project file.#include "stdafx.h"using namespace System;using namespace System::Reflection;#define Office Microsoft::Office#define Word Office::Interop::Word#de...
2019-10-08 10:28:07
159
转载 调用COM接口建立一个AppointmentItem并在Body中添加链接
// Outlook_AddLink.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include <Windows.h>HRESULT AutoWrap(int autoType, VARIANT *pvResult, IDispatch *...
2019-10-08 10:28:07
124
转载 VBA Word CustomXMLPart 中在指定的Node"前添加Node
网上我看见有人想用InsertNodeBefore来实现这个想法。代码如下:Sub HowDoesInsertNodeBeforeWork()Dim oCXPart As CustomXMLPartDim oCXNode As CustomXMLNodeDim strXML As StringstrXML = "<?xml version='1.0' ?&g...
2019-10-08 10:28:05
172
转载 一个调用Shell的VBA程序
这个程序很强大但是如果参数错了同样要出问题,这里提供一个示例:=ShellAndWait("cmd",1000,4,2) 结果应为0Option ExplicitOption Compare Text ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''...
2019-10-08 10:28:04
460
转载 使用OpenXml向空白文档添加一个带表格线的表
using System;using System.Collections.Generic;using System.Linq;using System.Text;using DocumentFormat.OpenXml.Packaging;using DocumentFormat.OpenXml.Wordprocessing;using com.mksword.Ne...
2019-10-08 10:28:03
155
转载 获取Excel中Undo按钮的项目
在VSTO中我们可以通过以下代码来获取Undo按钮的列表: private static Office.CommandBars getCommandBars() { return (Office.CommandBars)Globals.ThisWorkbook.Application.GetType().InvokeMem...
2019-10-08 10:28:02
389
转载 调用COM来实现在最后一个Worksheet后插一个新的Worksheet
// InsertAfterSheets.cpp : Defines the entry point for the console application.//#include "stdafx.h"HRESULT AutoWrap(int autoType, VARIANT *pvResult, IDispatch *pDisp, LPOLESTR ptName,...
2019-10-08 10:28:01
106
转载 使用OpenXml转换docx内容为RTF
实际上这是个非常蛋疼的命题。它需要你有两个方面的能力:1.你实际RTF格式。2.你知道在OpenXml格式的文档中各种Style存在于哪个部份。由于完整的RTF style非常多。我这里只写了一个最简单的例子,希望它能起排线的作用:假设我有一个docx文档如下:Hello!This is a test text.用Open Xm...
2019-10-08 10:28:01
299
转载 Word文档用代码移除Header
在PIA中Microsoft 似乎没有给出移除Header的方法。在实践中我发现下面代码能做到这一点: Dim wdApp As Word.Application Dim wdDoc As Word.Document Dim wdSection As Word.Section wdApp = Globals.This...
2019-10-08 10:27:59
287
转载 在Word文档中连继用代码添两个表的方法
【要点】:在Word中添加两个表时中间必须空出一行,否则这两个表会合并成一个表。另外,当用代码添加完第一个表后必须将光标移出表格,否则第二个表格会套嵌在第一个表格中。以下是代码:Public Class ThisDocument Private Sub ThisDocument_Startup() Handles Me.Startup D...
2019-10-08 10:27:59
148
转载 从剪贴板上读取Outlook中的邮件
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using S...
2019-10-08 10:27:57
140
转载 关于 Office的Error 1935(HRESULT:0x8007054F)的修复
在安装Office的时候可能会遇上标题所描述的问题。这是应为.NET Framework 的某些组件没有被开启的原因。一般的解决方案是重新安装.NET Framework。或在控制面板上选择开启.NET Framework。欢迎访问《许阳的红泥屋》欢迎访问《许阳的红泥屋》转载于:https://www.cnblogs.com/mks...
2019-10-08 10:27:56
2013
转载 使用Inlinestring和在Inlinestring中实现line break
在Openxml中使用SharedStringTablePart储存文字信息比较麻烦。在实际操作过程中使用InlineString是个不错的选择。在下面的例子中我将演示如何使用InlineString。另外在这个示例中,为了实现line break的效果,我设置了单无格的自动换行。这个也可能是最简的自动换行的设置。我把它放在这里供大家参考。using System;us...
2019-10-08 10:27:55
147
转载 用CLR C++ 创建一个Word文档并画一张带表格线的表
#pragma once#define Word Microsoft::Office::Interop::Wordnamespace WordTableBoards { using namespace System; using namespace System::ComponentModel; using namespace System::Collectio...
2019-10-08 10:27:55
169
转载 Word InsertSymbolDialog Bug
在2007以后的Word下版中,你会发现InsertSymoblDialg的返回值永远是-1,不管你怎么操作都会向文档插入点什么。欢迎访问《许阳的红泥屋》转载于:https://www.cnblogs.com/mksword/archive/2012/09/02/3934039.html...
2019-10-08 10:27:54
67
转载 一个用PowerShell打开文档并将其另存为的脚本
$wdApp = New-Object -Com Word.Application$wdApp.Visible = $true$File1 = '*****************************'$File2 = '*****************************'$wdDoc = $wdApp.Documents.Open($File1)$wdFo...
2019-10-08 10:27:53
424
转载 从SharePoint 2010网站上导出list的方法
我们可从SharePoint网站上导出iqy文件然后把iqy文件导入Excel。还有我们可以用VBA来做这个事情,代码如下:Sub ImplementSharePointList() Dim HomeAddress As String Dim ListID As String Dim ViewID As String Dim SourceAdd...
2019-10-08 10:27:52
176
转载 Office 64位下建UDF
基本做法同http://blog.youkuaiyun.com/tx_officedev/article/details/7333018只是不要选中Register for COM Interop。然后通过C:\Windows\Microsoft.NET\Framework64\v4.0.30319\regasm /codebase "[dll的路径]"来注册UDF。欢...
2019-10-08 10:27:51
80
转载 一个WinWord Bug
重现步骤:当你打开一个新文档,键入"TEST TEST TEST "后保存,你会发现Words个数不是3而是5。(在Word2010上已经重现)。欢迎访问《许阳的红泥屋》转载于:https://www.cnblogs.com/mksword/archive/2012/08/21/3934043.html...
2019-10-08 10:27:50
55
转载 使用OpenXml 2.0向Excel文档加入自定义Ribbon
Ribbon.xml<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"> <ribbon> <tabs> <tab id="CustomTab" label="My Tab"> <group id="MyG...
2019-10-08 10:27:49
154
转载 Microsoft Project的RibbonXml VBA项目中不能使用带参数的过程
如果在Microsoft Project 使用以下代码:Sub gallery_MSN_getItemCount(control As IRibbonControl, ByRef returnedVal) On Error Resume Next returnedVal = 12End SubPublic Sub gallery_M...
2019-10-08 10:27:47
206
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人