VSTO词-更改绝对位置的类型? [英] Word VSTO - Change the absolute positions' type?

查看:112
本文介绍了VSTO词-更改绝对位置的类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下VB.NET(VSTO)代码在MS-Word中添加形状,

I use the following VB.NET (VSTO) code to add a shape in MS-Word,

Dim app As Word.Application = Globals.ThisAddIn.Application
Dim doc As Word.Document = app.ActiveDocument
Dim left As Single = CSng(Convert.ToDouble(app.Selection.Information(Word.WdInformation.wdHorizontalPositionRelativeToPage)))
Dim top As Single = CSng(Convert.ToDouble(app.Selection.Information(Word.WdInformation.wdVerticalPositionRelativeToPage)))
Dim shape As Word.Shape = doc.Shapes.AddShape(1, left, top, 225.1F, 224.5F)

shape.Fill.BackColor.RGB = ColorTranslator.ToOle(Color.Transparent)
shape.Fill.Visible = Microsoft.Office.Core.MsoTriState.msoFalse
shape.Fill.Transparency = 0.0F
shape.Line.Transparency = 0.0F
shape.Line.Visible = Microsoft.Office.Core.MsoTriState.msoFalse

此代码的作用是,在光标处添加一个矩形形状并使之透明(背景和线条).

What this code does is, it adds a rectangle shape at cursor point and makes it transparent (both background and line).

现在,我想更改绝对位置的类型.为了进一步说明,选择矩形形状时,然后选择功能区选项卡格式>位置>更多布局选项... ,如下图所示,

Now I like to change the absolute positions' type. To explain further, when you select the rectangle shape, then if you select the Ribbon tab Format > Position > More Layout Options... as shown in the image below,

它将打开以下对话框,

在上面的对话框中,我想将用红色矩形标记的段落更改为边距类型.如何通过代码做到这一点?

In the above dialog I like to change Column and Paragraph marked by the red rectangles into the type Margin. How to do this by code?

推荐答案

此问题的解决方案已在下面的链接中解决,

The solution to this was solved in the link below,

查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆