最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
在word中如何控制graph控件
时间:2022-07-02 11:53:16 编辑:袖梨 来源:一聚教程网
Dim objShape As Word.InlineShape
Dim objChart As Object
Dim objDataSheet As Object
Dim axis As Graph.Axis
Dim strKey as string 'bookmark的名称
'首先要在word中嵌入一个graph,然后把这个graph添加一个bookMark(书签),名字就是strKey的内容
objShape = mobjDoc.Bookmarks.Item(strKey).Range.InlineShapes.Item(1)
objShape.OLEFormat.DoVerb(VerbIndex:=Word.WdOLEVerb.wdOLEVerbHide)
objChart = objShape.OLEFormat.Object()
'设置横轴的属性
axis = objChart.Axes(2, 1)
'最小刻度
axis.MinimumScale = 0
'主要刻度单位
axis.MajorUnit = 10
'次要刻度单位
axis.MinorUnit = 10
'最大刻度
axis.MaximumScale = 50
'在graph的表格中填写内容
objDataSheet = objChart.Application.DataSheet
Dim objChart As Object
Dim objDataSheet As Object
Dim axis As Graph.Axis
Dim strKey as string 'bookmark的名称
'首先要在word中嵌入一个graph,然后把这个graph添加一个bookMark(书签),名字就是strKey的内容
objShape = mobjDoc.Bookmarks.Item(strKey).Range.InlineShapes.Item(1)
objShape.OLEFormat.DoVerb(VerbIndex:=Word.WdOLEVerb.wdOLEVerbHide)
objChart = objShape.OLEFormat.Object()
'设置横轴的属性
axis = objChart.Axes(2, 1)
'最小刻度
axis.MinimumScale = 0
'主要刻度单位
axis.MajorUnit = 10
'次要刻度单位
axis.MinorUnit = 10
'最大刻度
axis.MaximumScale = 50
'在graph的表格中填写内容
objDataSheet = objChart.Application.DataSheet