VSTO开发入门教程
¥
41.42
9.2折
¥
45
九五品
仅1件
作者刘永富
出版社清华大学出版社
出版时间2017-01
版次1
装帧其他
货号A6
上书时间2024-12-17
商品详情
- 品相描述:九五品
图书标准信息
-
作者
刘永富
-
出版社
清华大学出版社
-
出版时间
2017-01
-
版次
1
-
ISBN
9787302453710
-
定价
45.00元
-
装帧
其他
-
开本
16开
-
纸张
胶版纸
-
页数
225页
-
字数
372千字
- 【内容简介】
-
本书从初学者角度出发,详细介绍了使用C#语言进行VSTO开发需要掌握的知识。全书分为12章,内容包括VSTO入门概述、C#语法基础、C#进阶技术、C#操作Excel对象、创建Office外接程序、自定义Office功能区、自定义任务窗格、自定义工具栏,VSTO外接程序的部署分发、VSTO开发Office文档、VSTO开发资源大全、C#与VB/VBA语言的差异对比。书中所有章节涉及的程序代码都给出了详细的注释。本书可以让读者轻松熟悉Visual Studio开发环境,跨入C#编程的门槛,掌握VSTO开发的步骤。本书可作为职场办公人员、高校理工科师生、Office专业开发人员自学用书,也可以作为Office编程培训讲师的教学参考书。
- 【作者简介】
-
刘永富,化学工程专业博士,微软office大师、vba专家、51cto学院认证讲师,网名ryueifu。他对office及其vba,以及vto开发有十余年的深入研究,尤其精通0ffice各组件的vba编程和vb6的应用开发。独立创作多项office vba相关作品、教程,代表技术作品有:ueapi、officemandbarviewer、ribbonxmleditor、exceladdin、vbe2014、viualtudioaddin2016等,这些原创作品深受广大学者的欢迎。
- 【目录】
-
第1章 VSTO入门概述················1
1.1 VSTO简述 ·································· 1
1.1.1 VSTO的功能与特点 ······················· 1
1.1.2 VSTO开发语言 ····························· 2
1.1.3 VSTO开发环境配置 ······················· 3
1.1.4 Visual Studio开发环境 ·····················4
1.1.5 Visual Studio版本沿革 ·····················4
1.1.6 Visual Studio的安装 ························ 4
1.2 创建第一个C#应用程序 ················· 5
1.2.1 控制台应用程序 ···························· 5
1.2.2 Windows窗体应用程序 ··················· 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.5 Visual 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
第2章 C#语法基础··················· 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.1 ToString·····································31
2.4.2 Parse·········································31
2.4.3 Convert······································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.2 if语句 ········································38
2.6.3 switch语句 ··································39
2.7 循环语句 ···································40
2.7.1 while循环 ···································40
2.7.2 do循环 ·······································41
2.7.3 for循环 ······································42
2.7.4 foreach循环·································43
2.8 流程控制语句 ·····························43
2.8.1 break语句 ···································43
2.8.2 continue语句 ·······························44
2.8.3 goto语句 ····································44
2.8.4 return语句 ···································45
2.9 输出对话框(MessageBox) ··········46
2.9.1 MessageBox语法 ··························46
2.9.2 自定义对话框的按钮 ·····················47
2.9.3 自定义对话框的图标 ·····················48
2.9.4 自定义对话框默认按钮 ··················48
2.9.5 处理对话框的用户响应 ··················48
2.10 输入对话框(InputBox)
·············49
2.11 过程与函数 ······························50
2.11.1 过程与函数的定义 ······················50
2.11.2 过程与函数的调用 ······················51
2.12 类的创建和使用 ························52
2.12.1 非静态类 ··································52
2.12.2 静态类 ·····································54
2.13 using指令 ·································55
2.14 错误处理 ·································55
本章要点回顾····································56
第3章 C#进阶技术···················57
3.1 文件与文件夹操作 ·······················57
3.1.1 System.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
第4章 C#操作Excel对象·········· 102
4.1
Excel对象模型概述 ····················102
4.1.1 Application对象 ·························· 103
4.1.2 Workbook 对象 ··························· 104
4.1.3 Worksheet 对象 ··························· 104
4.1.4 Range对象 ································ 105
4.1.5 Window 对象 ······························ 105
4.2
创建可以访问Excel对象的C#窗体
应用程序································· 105
4.2.1 添加Excel 2010对象引用 ·············· 105
4.2.2 添加Office 2010对象引用 ·············· 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.1 Workbook 对象常用属性··············· 112
4.4.2 Workbook 对象常用方法··············· 113
4.4.3 Workbook 对象常用事件··············· 114
4.4.4 Workbook 重要集合对象··············· 114
4.5 操作Worksheet 对象 ····················115
4.5.1 Worksheet 对象常用属性 ··············· 115
4.5.2 Worksheet 对象常用方法 ··············· 116
4.5.3 Worksheet 对象常用事件 ··············· 117
4.6 操作Range对象 ························· 117
4.6.1 Range对象常用属性···················· 117
4.6.2 Range对象常用方法···················· 118
4.6.3 Range对象的遍历 ······················· 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.1 CustomUI的意义 ························140
6.1.2 CustomUI的作用范围 ··················140
6.1.3 手工定制Office界面 ····················140
6.2 CustomUI与XML ·······················141
6.2.1 XML语法规则 ···························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.2 Group中加入DialogBoxLauncher ·····157
6.5 使用XML进行CustomUI定制 ········159
本章要点回顾··································162
第7章自定义任务窗格 ············163
7.1 任务窗格行为控制 ·····················163
7.2 VSTO外接程序项目中添加任务
窗格 ·······································164
7.2.1 创建Excel 2010外接程序 ··············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.1 Commandbar对象 ·······················174
8.1.2 CommandbarControl对象 ··············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
第9章 VSTO外接程序的部署分发···182
9.1 客户机搭建VSTO运行环境 ··········182
9.2 VSTO外接程序的简单安装 ··········183
9.3 使用Advanced Installer ················184
9.3.1 创建aip安装包工程 ·····················184
9.3.2 客户机运行安装包 ······················193
本章要点回顾··································194
第10章 VSTO开发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
第11章 VSTO开发资源大全·····212
11.1 Office 2003以下版本工具栏和控件的
自定义 ··································212
11.1.1 OfficeCommandbarDesigner··········212
11.1.2 OfficeCommandbarViewer············213
11.1.3 FaceIDViewer···························213
11.2 Office 2007以上版本功能区的
自定义 ··································215
11.2.1 Office2010ControlIDs·················215
11.2.2 imageMso7345··························216
11.2.3 OfficeCustomUIEditor·················217
11.2.4 Ribbon XML Editor····················217
11.2.5 Ribbon回调函数大全 ··················217
11.3 编程环境辅助工具 ···················218
11.3.1 VBE2014································219
11.3.2 VisualStudioAddin2016···············220
第12章 C#与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
点击展开
点击收起
— 没有更多了 —
以下为对购买帮助不大的评价