隐藏整个ContentControl [英] Hide entire ContentControl

查看:115
本文介绍了隐藏整个ContentControl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常简单的要求。我需要在word-addin 2007项目(c#4.0和Visual Studio 2010)中使用interop在ms-word 2007中隐藏整个contentcontrol。

I have a very simple requirement. I need to hide an entire contentcontrol in ms-word 2007 by using interop in a word-addin 2007 project (c# 4.0 and Visual Studio 2010).

我正在迭代文档中的所有ContentControls使用  document.ContentControls。我希望每个ContentControl都被隐藏。我使用以下代码:

I am iterating all ContentControls in the document by using document.ContentControls. I want each ContentControl to be hidden. I am using the following code:

contentControl.Range.Font.Hidden = 1;

contentControl.Range.Font.Hidden = 1;

但这只会影响ContentControl的内容。

But this only affects the content of the ContentControl.

在单词中我可以通过首先选择整个contentControl(单击夹点)并将字体设置为隐藏来完成此操作。是否有可能在互操作中做同样的事情?

In word I am able to do this by first selecting the entire contentControl (clicking on the grip) and set the font to hidden. Is there a possibility to do the same in interop?

关心,

Koray

Regards,
Koray

F / \\\
t / \\\ PRODUCTIONS

F/\nt/\sy PRODUCTIONS

推荐答案

我想。内容控件的范围是上述控件内的占位符 - 你必须抓住范围包含控件或尝试将一个控件扩展为一个字符左右。
i guess that .Range of content control is a place holder inside aforementioned control - you have to grab range that contains control or try to expand the one from control to one character to left and right.


这篇关于隐藏整个ContentControl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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