如何使用进行二次开发的
调用工具条对象、菜单对象的方法
mandBars
mandBars共享Office对象模型
使用CommandBar代替UIObject
CommandBar对象中,菜单及工具条是同一个东西。CommandBar、CommandBarButton、CommandBarComboBox、CommandBarControl和CommandBarPopup。
示例:执行视图中的工具条的所有按钮事件。
mandBars commandBars;
commandBars = (mandBars)mandBars;
foreach (mandBarControl control in commandBars[\"View\"].Controls)
{
mandBarButton button =
control as mandBarButton;
if (button != null)
{
ecute();
}
}
StringBuilder sb = new StringBuilder();
foreach (mandBar bar in commandBars)
{
pend(rmat(\"CommandBar Name:{0}\\r\\n\", ));
foreach(mandBarControl control in ntrols)
{
mandBarButton button = control as
mandBarButton;
if(button != null)
{
pend(rmat(\"Button Name:{0} \\r\\n\", ption));
}
}
}
Form2 frm = new Form2();
xt = String();
ow();
short flags = (short)sOpenDocked | (short)sOpenRO;
StencilOpenEx(plication, flags);
/**////
/// 打开模具的公共方法
///
/// 按引用调用的VisioApplication对象
/// 打开的模式
private void StencilOpenEx(Application visApp, short flags)
{
List stencilList = GetStencils();
string stencilFileName;
foreach(string stencil in stencilList)
{
stencilFileName = GetStencilsFileName(stencil);
if(!NullOrEmpty(stencilFileName))
{
enEx(tencileFileBasePath + stencilFileName, flags);
}
}
}
//关闭模具文件
cuments[\"s\"].Close();
cuments[\"s\"].Close();
cuments[\"s\"].Close();
cuments[\"s\"].Close();
cuments[\"s\"].Close();
cuments[\"s\"].Close();
Visio Shape的属性操作
StringToFormulaForString、FormulaStringToString函数
访问属性
设置属性
添加属性
//列出模具组
ear();
List stencilGroups = tStencils();
foreach (string group in stencilGroups)
{
d(group);
}
//根据模具组列出模具
string stencilName = tStencilsFileName(xt);
ear();
string tempName;
foreach (Master master in cuments[stencilName].Masters)
{
tempName = ;
if (!ExcludeItem(tempName))
{
d(tempName);
}
}
//根据模具,获取对应的属性集合,遍历属性集合,列出属性名称
string stencilName = tStencilsFileName(xt);
string masterName = xt;
ape shape = cuments[stencilName].Masters[masterName].Shapes[1];
if (shape != null)
{
List propInfos = tPropertyCollection(shape);
foreach (StencilPropertyInfo info in propInfos)
{
d();
}
}
//根据模具、模具属性,列出对应的属性信息
string stencilName = tStencilsFileName(xt);
string masterName = xt;
ape shape = cuments[stencilName].Masters[masterName].Shapes[1];
StencilPropertyInfo info = tProperty(shape, xt);
if (info != null)
{
xt = ;//属性名称
xt = lue;//属性值
xt = rmat;//属性格式
xt = rt;//属性的排序
xt = ompt;//属性的提示信息
}
//根据模具,获取属性对象集合
public List GetPropertyCollection(ape shape)
{
List list = new List();
StencilPropertyInfo propertyInfo;
ll shapeCell;
short shortSectionProp = (short)sSectionProp;
if (shape != null)
{
for (short i = 0; i t_RowCount(shortSectionProp) - 1; i++ )
{
if (t_CellsSRCExists(shortSectionProp, i,
(short)sCustPropsLabel, 0) != 0)
{
propertyInfo = new StencilPropertyInfo();
shapeCell = t_CellsSRC(shortSectionProp, i,
(short)sCustPropsLabel);
= rmulaStringToString(wNameU);
shapeCell = t_CellsSRC(shortSectionProp, i,
(short)sCustPropsPrompt);
ompt = rmulaStringToString(rmulaU);
shapeCell = t_CellsSRC(shortSectionProp, i,
(short)sCustPropsFormat);
rmat = rmulaStringToString(rmulaU);
shapeCell = t_CellsSRC(shortSectionProp, i,
(short)sCustPropsValue);
lue = rmulaStringToString(rmulaU);
shapeCell = t_CellsSRC(shortSectionProp, i,
(short)sCustPropsSortKey);
rt = rmulaStringToString(rmulaU);
//shapeCell = t_CellsSRC(shortSectionProp, i,
(short)sCustPropsType);
//opType = rmulaStringToString(rmulaU);
//shapeCell = t_CellsSRC(shortSectionProp, i,
(short)sCustPropsInvis);
//Visible = rmulaStringToString(rmulaU);
//..
d(propertyInfo);
}
}
}
return list;
}
//根据模具和属性名称,获取属性对象信息
public StencilPropertyInfo GetProperty(ape shape, string propertyName)
{
List list = GetPropertyCollection(shape);
StencilPropertyInfo propertyInfo = null;
foreach(StencilPropertyInfo tempInfo in list)
{
if ( == propertyName)
{
propertyInfo = tempInfo;
break;
}
}
return propertyInfo;
又到了各大市场调研机构发布最新智能出货量、各大厂商市场份额的时候了。与每次的波澜不惊相比 }
查看本文来源
南昌治疗白癜风哪家好短效避孕药避孕原理
西宁妇科习惯性流产治疗哪家好
- 上一页:如何使用在发送往的内容上加呢
- 下一页:如何使用从文件中加载
-
为什么你会为爱情而扭曲
为什么你会为爱人情而改变,只是因为,你厌恶夺去。当你恐惧夺去一个人的...
2024-12-27
-
深圳要蒸发了?DQ海岸城新店高能来袭,掀起今夏潮cool风暴!
走入DQ在海岸城的新近门超市 流泪满脸问号,这真的不是潮牌超市吗? 润酷...
2024-09-08
-
关乎大资金动向!科创板“芯片”指数来了,42只样本股名单公布;上交所几大指数也调整,腾讯、美团等权重
A股、公司股票多个极其重要指标公布或修正,这意味着之外的大资金样式也...
2024-06-24
-
54岁郑钧好可怕,与小16岁娇妻在机场热吻,剪齐刘海刻意扮嫩
过去的服装辅以领域已经形成了用语的品味,相同的用语有相同的品味标准和...
2024-06-02
-
民间故事:新媳妇回娘家,见继父做荒唐事,相劝不成梦中被骗身
元代大安末年,胡山阳县药王庙山村有个都官叫杨辅大,他膝下有两个女儿,...
2024-05-16
-
每经14点 | 国家医保局:继续降低乙型肝炎、核酸检测等价格;雄安新区为拟挂牌上市企业提供“一对一管
每经总编:陈鹏程 1丨雄安高新区为拟万科母该公司民营企业提供“PK管家式...
2024-05-11