码迷,mamicode.com
首页 > 编程语言 > 详细

VBA改变visio图形内控件内容和颜色

时间:2017-08-03 01:06:41      阅读:864      评论:0      收藏:0      [点我收藏+]

标签:cells   cat   利用   each   帮助   page   图形   dos   guard   

主要利用visio开发者模式,在没有开发帮助文档的情况下,实现对visio文件的处理

技术分享

 

 

Sub Macro3()

‘Enable diagram services
Dim DiagramServices As Integer
DiagramServices = ActiveDocument.DiagramServicesEnabled
ActiveDocument.DiagramServicesEnabled = visServiceVersion140 + visServiceVersion150

Application.ActiveWindow.SelectAll

‘Restore diagram services
Dim UndoScopeID1 As Long
UndoScopeID1 = Application.BeginUndoScope("填充颜色")

For Each ItemFrom In Application.ActiveWindow.Page.Shapes
Set vsoCharacters = ItemFrom
vsoCharacters.Characters.Text = "okokokokokokokok"

vsoCharacters.CellsSRC(visSectionObject, visRowFill, visFillForegnd).FormulaU = "THEMEGUARD(RGB(255,0,0))"
vsoCharacters.CellsSRC(visSectionObject, visRowFill, visFillBkgnd).FormulaU = "THEMEGUARD(SHADE(FillForegnd,LUMDIFF(THEMEVAL(""FillColor""),THEMEVAL(""FillColor2""))))"
vsoCharacters.CellsSRC(visSectionObject, visRowGradientProperties, visFillGradientEnabled).FormulaU = "FALSE"

Next

Application.EndUndoScope UndoScopeID1, True
End Sub

 

 

 

技术分享

 

VBA改变visio图形内控件内容和颜色

标签:cells   cat   利用   each   帮助   page   图形   dos   guard   

原文地址:http://www.cnblogs.com/ddwarehouse/p/7277356.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!