VSTO开发入门教程 VSTO开发Office的经典书籍 VSTO开发指南 职场办公 Office专业开发人员自学用书 Office编程培训教材书.

  • VSTO开发入门教程 VSTO开发Office的经典书籍 VSTO开发指南 职场办公 Office专业开发人员自学用书 Office编程培训教材书.
  • 所属分类:
    发货地:桂林
  • 价    格:42
  • 市场价格:
  • 今日价格: 有特价请联系
  • 优惠详情: 剩余数量总共数量
  • 最近热度:
  • 累计热度:
  • 综合得分:
  • 信誉得分:
  • 品牌:
  • 货号:5ddddb898b5b
  • 立刻联系购买联系商家新书源图书专营店

        本商品由新书源图书专营店提供,通过新书源图书专营店完成交易,请放心购物

  • 产品名称:VSTO开发入门
  • 书名:VSTO开发入门
  • 出版时间:2017.1
  • 定价:45.00元
  • 是否是套装:否

VSTO开发入门教程

 

作者:刘永富

定价:45

印次:1-1

ISBN(咨询特价)

出版日期:2017.(咨询特价)

本书从初学者角度出发,详细介绍了使用C#语言进行VSTO开发需要掌握的知识。全书分为12章,内容包括VSTO入门概述、C#语法基础、C#进阶技术、C#操作Excel对象、创建Office外接程序、自定义 Office功能区、自定义任务窗格、自定义工具栏,VSTO外接程序的部署分发、VSTO开发Office文档、 VSTO开发资源大全、C#与VB/VBA语言的差异对比。书中所有章节涉及的程序代码都给出了详细的注释。本书可以让读者轻松熟悉Visual Studio开发环境,跨入C#编程的门槛,掌握VSTO开发的步骤。 本书可作为职场办公人员、高校理工科师生、Office专业开发人员自学用书,也可以作为Office编程培训讲师的教学参考书。

 

目录

 

 

1VSTO入门概述 ················1

 

 

 

1.1 VSTO简述 ··································1

 

 

 

1.1.1VSTO的功能与特点 ·······················1

 

 

 

1.1.2VSTO开发语言 ·····························2

 

 

 

1.1.3VSTO开发环境配置 ·······················3

 

 

 

1.1.4Visual Studio开发环境 ·····················4

 

 

 

1.1.5Visual Studio版本沿革 ·····················4

 

 

 

1.1.6Visual Studio的安装 ························4

 

 

 

1.2创建一个C#应用程序 ·················5

 

 

 

1.2.1控制台应用程序 ····························5

 

 

 

1.2.2Windows窗体应用程序 ···················9

 

 

 

1.2.3生成可执行文件 ···························11

 

 

 

1.3认识Visual Studio开发环境·············11

 

 

 

1.3.1【文件】菜单 ······························12

 

 

 

1.3.2【视图】菜单 ······························12

 

 

 

1.3.3【项目】菜单 ······························12

 

 

 

1.3.4菜单栏和工具栏的自定义 ···············13

 

 

 

1.3.5Visual Studio选项 ··························14

 

 

 

1.4 Visual Studio项目组织结构 ·············14

 

 

 

1.4.1解决方案 ····································14

 

 

 

1.4.2项目 ··········································17

 

 

 

1.4.3类模块 ·······································18

 

 

 

 

 

 

 

1.4.4引用管理 ····································18

 

 

 

1.5使用帮助系统 ·····························19

 

 

 

1.5.1设置帮助查看方式 ························19

 

 

 

1.5.2下载和安装Help Viewer··················19

 

 

 

1.5.3管理帮助内容 ······························19

 

 

 

本章要点回顾····································21

 

 

 

2C#语法基础 ···················22

 

 

 

2.1变量的声明和赋值 ······················22

 

 

 

2.1.1常用的数据类型 ···························22

 

 

 

2.1.2赋值运算符 ·································23

 

 

 

2.1.3变量的作用范围 ···························23

 

 

 

2.2字符与字符串处理 ·······················24

 

 

 

2.2.1字符变量 ····································24

 

 

 

2.2.2字符串变量 ·································25

 

 

 

2.2.3转义字符 ····································26

 

 

 

2.2.4字符串连接 ·································27

 

 

 

2.2.5子字符串 ····································27

 

 

 

2.2.6格式化字符串 ······························28

 

 

 

2.2.7字符串的替换 ······························28

 

 

 

2.2.8字符串与数组 ······························28

 

 

 

2.3逻辑运算 ···································29

 

 

 

2.3.1布尔型变量 ·································29

 

 

 

2.3.2比较运算符 ·································30

 

 

 

2.3.3多条件的与或非运算 ·····················30

 

 

 

2.4不同类型的强制转换 ····················31

 

 

 

2.4.1ToString ·····································31

 

 

 

2.4.2 Parse ·········································31

 

 

 

2.4.3Convert ······································32

 

 

 

2.5使用数组 ···································33

 

 

 

2.5.1数组的声明和初始化 ·····················33

 

 

 

2.5.2一维数组 ····································33

 

 

 

2.5.3数组素的遍历 ···························34

 

 

 

2.5.4二维数组 ····································35

 

 

 

2.6条件选择语句 ·····························37

 

 

 

2.6.1三运算符 ·································37

 

 

 

2.6.2if语句 ········································38

 

 

 

2.6.3switch语句 ··································39

 

 

 

2.7循环语句 ···································40

 

 

 

2.7.1while循环 ···································40

 

 

 

2.7.2do循环 ·······································41

 

 

 

2.7.3for循环 ······································42

 

 

 

2.7.4foreach循环·································43

 

 

 

2.8流程控制语句 ·····························43

 

 

 

2.8.1break语句 ···································43

 

 

 

2.8.2continue语句 ·······························44

 

 

 

2.8.3goto语句 ····································44

 

 

 

2.8.4return语句 ···································45

 

 

 

2.9输出对话框(MessageBox ··········46

 

 

 

2.9.1MessageBox语法 ··························46

 

 

 

2.9.2自定义对话框的按钮 ·····················47

 

 

 

2.9.3自定义对话框的图标 ·····················48

 

 

 

2.9.4自定义对话框默认按钮 ··················48

 

 

 

2.9.5处理对话框的用户响应 ··················48

 

 

 

(咨询特价)输入对话框(InputBox

 

 

 

·············49

 

 

 

(咨询特价)过程与函数 ······························50

 

 

 

(咨询特价).1过程与函数的定义 ······················50

 

 

 

(咨询特价).2过程与函数的调用 ······················51

 

 

 

(咨询特价)类的创建和使用 ························52

 

 

 

(咨询特价).1非静态类 ··································52

 

 

 

(咨询特价).2静态类 ·····································54

 

 

 

(咨询特价) using指令 ·································55

 

 

 

(咨询特价)错误处理 ·································55

 

 

 

本章要点回顾····································56

 

 

 

3C#进阶技术 ···················57

 

 

 

 

 

 

 

3.1文件与文件夹操作 ·······················57

 

 

 

3.1.1System.IO命名空间 ·······················57

 

 

 

3.1.2文件与文件夹处理实例 ··················58

 

 

 

3.2文本文件的读写 ··························59

 

 

 

3.3数据库操作 ································60

 

 

 

3.4使用资源文件 ·····························61

 

 

 

3.4.1添加资源文件 ······························62

 

 

 

3.4.2资源文件中的字符串 ·····················62

 

 

 

3.4.3资源文件中的图像 ························63

 

 

 

3.5使用正则表达式 ··························65

 

 

 

3.5.1创建Regex对象 ····························65

 

 

 

3.5.2字符 ·······································65

 

 

 

3.5.3正则表达式选项 ···························66

 

 

 

3.5.4正则表达式方法 ···························67

 

 

 

3.5.5正则表达式测试器 ························71

 

 

 

3.6使用字典 ···································72

 

 

 

3.6.1字典对象的创建 ···························72

 

 

 

3.6.2根据键检索值 ······························73

 

 

 

3.6.3遍历所有键名 ······························74

 

 

 

3.6.4遍历所有值 ·································74

 

 

 

3.6.5去除重复 ····································74

 

 

 

3.7窗体设计技术 ·····························76

 

 

 

3.7.1窗体的显示 ·································76

 

 

 

 

 

 

 

3.7.2窗体的卸载 ·································77

 

 

 

 

 

 

 

3.7.3窗体与控件的事件 ························78

 

 

 

 

 

 

 

3.7.4使用窗体菜单 ······························82

 

 

 

 

 

 

 

3.7.5使用工具栏 ·································85

 

 

 

 

 

 

 

3.7.6使用右键菜单 ······························87

 

 

 

 

 

 

 

3.7.7使用状态栏 ·································88

 

 

 

 

 

 

 

3.7.8使用文件选择对话框 ·····················90

 

 

 

 

 

 

 

3.7.9运行期间动态增删控件 ··················91

 

 

 

 

 

 

 

3.8使用Windows API函数 ··················94

 

 

 

 

 

 

 

3.8.1窗口类名和句柄 ···························95

 

 

 

 

 

 

 

3.8.2

 

 

 

使用Spy++··································98

 

 

 

 

 

 

 

3.8.3

 

 

 

使用UseAPI······························100

 

 

 

 

 

 

 

3.8.4获取光标位置 ····························101

 

 

 

本章要点回顾··································101

 

 

 

 

 

 

 

4C#操作Excel对象··········102

 

 

 

 

 

 

 

4.1

 

 

 

Excel对象模型概述 ····················102

 

 

 

 

 

 

 

4.1.1 Application对象 ··························103

 

 

 

 

 

 

 

4.1.2Workbook对象 ···························104

 

 

 

 

 

 

 

4.1.3Worksheet对象 ···························104

 

 

 

 

 

 

 

4.1.4Range对象 ································105

 

 

 

 

 

 

 

4.1.5Window对象 ······························105

 

 

 

 

 

 

 

4.2

 

 

 

创建可以访问Excel对象的C#窗体

 

 

 

应用程序 ·································105

 

 

 

 

 

 

 

4.2.1添加Excel (咨询特价)对象引用 ··············105

 

 

 

 

 

 

 

4.2.2添加Office (咨询特价)对象引用 ··············105

 

 

 

 

 

 

 

4.3操作Application对象 ···················107

 

 

 

 

 

 

 

4.3.1获取正在运行的Excel对象 ············107

 

 

 

 

 

 

 

4.3.2创建新的Excel对象 ·····················109

 

 

 

 

 

 

 

4.3.3 Application对象常用属性 ··············109

 

 

 

 

 

 

 

4.3.4 Application对象常用方法 ··············110

 

 

 

 

 

 

 

4.3.5 Application对象常用事件 ··············110

 

 

 

 

 

 

 

4.3.6 Application重要集合对象 ··············111

 

 

 

 

 

 

 

4.4操作Workbook对象····················112

 

 

 

 

 

 

 

4.4.1Workbook对象常用属性···············112

 

 

 

 

 

 

 

4.4.2Workbook对象常用方法···············113

 

 

 

 

 

 

 

4.4.3Workbook对象常用事件···············114

 

 

 

 

 

 

 

4.4.4Workbook重要集合对象···············114

 

 

 

 

 

 

 

4.5操作Worksheet对象 ····················115

 

 

 

 

 

 

 

4.5.1Worksheet对象常用属性 ···············115

 

 

 

 

 

 

 

4.5.2Worksheet对象常用方法 ···············116

 

 

 

 

 

 

 

4.5.3Worksheet对象常用事件 ···············117

 

 

 

 

 

 

 

4.6操作Range对象 ·························117

 

 

 

 

 

 

 

4.6.1Range对象常用属性····················117

 

 

 

 

 

 

 

4.6.2Range对象常用方法····················118

 

 

 

 

 

 

 

4.6.3Range对象的遍历 ·······················119

 

 

 

 

 

 

 

4.6.4二维数组与Range数据交换···········120

 

 

 

 

 

 

 

4.6.5一维数组与Range数据交换···········121

 

 

 

 

 

 

 

4.7操作Commandbar对象 ················121

 

 

 

 

 

 

 

4.8操作VBE工程 ··························123

 

 

 

 

 

 

 

4.8.1引用VBIDE类型库 ······················123

 

 

 

 

 

 

 

4.8.2允许对VBA工程访问 ··················123

 

 

 

 

 

 

 

4.8.3操作VBE各级对象 ······················125

 

 

 

 

 

 

 

4.9

 

 

 

创建Excel自定义函数 ·················125

 

 

 

 

 

 

 

4.9.1

 

 

 

使用C#创建类库 ························126

 

 

 

 

 

 

 

4.9.2

 

 

 

工作表中使用C#开发的自定义

 

 

 

公式 ········································129

 

 

 

 

 

 

 

4.9.3

 

 

 

VBA中调用C#开发的自定义公式 ···131

 

 

 

 

 

 

 

4.9.4

 

 

 

C#中调用C#开发的自定义公式 ······131

 

 

 

 

 

 

 

4.9.5客户机使用C#制作的自定义函数 ·······132

 

 

 

本章要点回顾··································133

 

 

 

 

 

 

 

5章创建Office外接程序·······134

 

 

 

 

 

 

 

5.1

 

 

 

Office COM加载项简介 ···············134

 

 

 

 

 

 

 

5.2

 

 

 

认识Office COM加载项管理

 

 

 

对话框 ····································134

 

 

 

 

 

 

 

 

 

 

 

5.3创建一个Office外接程序项目 ····135

 

 

 

 

 

 

 

5.4 ThisAddin的启动事件和卸载事件 ··136

 

 

 

 

 

 

 

本章要点回顾··································137

 

 

 

 

 

 

 

6 自定义Office功能区 ·······138

 

 

 

 

 

 

 

6.1 CustomUI概述 ··························138

 

 

 

 

 

 

 

6.1.1CustomUI的意义 ························140

 

 

 

 

 

 

 

6.1.2CustomUI的作用范围 ··················140

 

 

 

 

 

 

 

6.1.3手工定制Office界面 ····················140

 

 

 

 

 

 

 

6.2 CustomUIXML·······················141

 

 

 

 

 

 

 

6.2.1XML语法规则 ···························141

 

 

 

 

 

 

 

6.2.2描述Office界面的XML·················142

 

 

 

 

 

 

 

6.2.3使用Ribbon XML Editor···············148

 

 

 

 

 

 

 

6.3 CustomUI素详解 ····················149

 

 

 

 

 

 

 

6.3.1选项卡(tab)素 ·····················150

 

 

 

 

 

 

 

6.3.2组(group)素 ························151

 

 

 

 

 

 

 

6.3.3控件(control)素 ···················151

 

 

 

 

 

 

 

6.4 VSTO中使用功能区可视化

 

 

 

 

 

 

 

 设计器 ····································154

 

 

 

 

 

 

 

6.4.1为按钮指定回调过程 ···················156

 

 

 

 

 

 

 

6.4.2Group中加入DialogBoxLauncher·····157

 

 

 

 

 

 

 

6.5使用XML进行CustomUI定制 ········159

 

 

 

 

 

 

 

本章要点回顾··································162

 

 

 

 

 

 

 

7 自定义任务窗格 ············163

 

 

 

 

 

 

 

7.1任务窗格行为控制 ·····················163

 

 

 

 

 

 

 

7.2 VSTO外接程序项目中添加任务

 

 

 

 

 

 

 

 窗格 ·······································164

 

 

 

 

 

 

 

7.2.1创建Excel (咨询特价)外接程序 ··············165

 

 

 

 

 

 

 

7.2.2添加用户控件 ····························165

 

 

 

 

 

 

 

7.2.3静态类中声明任务窗格对象 ··········166

 

 

 

 

 

 

 

7.2.4创建并显示任务窗格 ···················167

 

 

 

 

 

 

 

7.3功能区与任务窗格的交互控制 ······169

 

 

 

 

 

 

 

7.3.1利用功能区切换按钮控制任务窗格的

 

 

 

 

 

 

 

 显示隐藏 ··································169

 

 

 

 

 

 

 

7.3.2处理自定义任务窗格事件 ·············172

 

 

 

 

 

 

 

7.3.3完全卸载任务窗格 ······················173

 

 

 

 

 

 

 

本章要点回顾··································173

 

 

 

 

 

 

 

8 自定义工具栏 ···············174

 

 

 

 

 

 

 

8.1 Office工具栏对象简述 ················174

 

 

 

 

 

 

 

8.1.1Commandbar对象 ·······················174

 

 

 

 

 

 

 

8.1.2CommandbarControl对象 ··············175

 

 

 

 

 

 

 

8.1.3自定义工具栏的作用和意义 ··········176

 

 

 

 

 

 

 

8.2 VSTO实现自定义工具栏 ·············176

 

 

 

 

 

 

 

8.2.1创建自定义工具栏 ······················176

 

 

 

 

 

 

 

8.2.2处理工具栏按钮的回调 ················178

 

 

 

 

 

 

 

8.2.3修改右键菜单 ····························179

 

 

 

 

 

 

 

8.2.4卸载外接程序时清除自定义 ··········180

 

 

 

 

 

 

 

本章要点回顾··································181

 

 

 

 

 

 

 

9VSTO外接程序的部署分发 ···182

 

 

 

 

 

 

 

9.1客户机搭建VSTO运行环境 ··········182

 

 

 

 

 

 

 

9.2 VSTO外接程序的简单安装 ··········183

 

 

 

 

 

 

 

9.3使用Advanced Installer················184

 

 

 

 

 

 

 

9.3.1创建aip安装包工程 ·····················184

 

 

 

 

 

 

 

9.3.2客户机运行安装包 ······················193

 

 

 

 

 

 

 

本章要点回顾··································194

 

 

 

 

 

 

 

10VSTO开发Office文档 ···195

 

 

 

 

 

 

 

10.1文档自定义项编程概述 ·············195

 

 

 

 

 

 

 

10.2文档自定义项允许添加的界面

 

 

 

 

 

 

 

  ·····································195

 

 

 

 

 

 

 

10.3创建Office文档项目 ··················196

 

 

 

 

 

 

 

10.3.1文档上添加C#控件 ····················198

 

 

 

 

 

 

 

10.3.2文档项目的启动事件过程 ···········198

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

10.4文档操作窗格概述 ···················199

 

 

 

 

 

 

 

10.5文档操作窗格综合实例 ·············200

 

 

 

 

 

 

 

10.5.1添加用户控件到文档窗格 ···········202

 

 

 

 

 

 

 

10.5.2添加多个相同控件到文档窗格 ·····204

 

 

 

 

 

 

 

10.5.3使用代码创建窗体控件并添加到

 

 

 

 

 

 

 

 文档操作窗格 ··························205

 

 

 

 

 

 

 

10.5.4定制功能区按钮控制文档操作

 

 

 

 

 

 

 

 窗格 ······································206

 

 

 

 

 

 

 

10.6文档自定义项的部署分发 ··········210

 

 

 

 

 

 

 

本章要点回顾··································211

 

 

 

 

 

 

 

11VSTO开发资源大全 ·····212

 

 

 

 

 

 

 

11.1 Office (咨询特价)以下版本工具栏和控件的

 

 

 

 

 

 

 

 自定义 ··································212

 

 

 

 

 

 

 

11.1.1OfficeCommandbarDesigner ··········212

 

 

 

 

 

 

 

11.1.2OfficeCommandbarViewer ············213

 

 

 

 

 

 

 

11.1.3FaceIDViewer ···························213

 

 

 

 

 

 

 

11.2 Office (咨询特价)以上版本功能区的

 

 

 

 

 

 

 

 自定义 ··································215

 

 

 

 

 

 

 

11.2.1Office2010ControlIDs ·················215

 

 

 

 

 

 

 

11.2.2imageMso7345 ··························216

 

 

 

 

 

 

 

11.2.3OfficeCustomUIEditor ·················217

 

 

 

 

 

 

 

11.2.4Ribbon XML Editor ····················217

 

 

 

 

 

 

 

11.2.5Ribbon回调函数大全 ··················217

 

 

 

 

 

 

 

11.3编程环境辅助工具 ···················218

 

 

 

 

 

 

 

11.3.1VBE2014 ································219

 

 

 

 

 

 

 

11.3.2VisualStudioAddin2016 ···············220

 

 

 

 

 

 

 

12C#VB/VBA语言的差异

 

 

 

 

 

 

 

 对比··························222

 

 

 

 

 

 

 

12.1变量必须声明 ·························222

 

 

 

 

 

 

 

12.2严格的类型匹配 ······················222

 

 

 

 

 

 

 

12.3项目的自动保存 ······················222

 

 

 

 

 

 

 

12.4严格区分大小写 ······················223

 

 

 

 

 

 

 

12.5语句结束必须加分号 ················223

 

 

 

 

 

 

 

12.6语句块 ··································223

 

 

 

 

 

 

 

12.7调用其他函数圆括号不能少 ·······224

 

 

 

 

 

 

 

12.8数组的下标为0························224

 

 

 

 

 

 

 

12.9数组或集合对象的索引使用

 

 

 

 

 

 

 

 方括号 ··································225

 

 

相关热门商品