简体   繁体   English

c# Word-AddIn 识别ribbon-tab拼写

[英]c# Word-AddIn recognize ribbon-tab spelling

Different Word versions have different tab spelling.不同的 Word 版本有不同的制表符拼写。 Some have the whole label as uppercase and others have just the first letter.有些将整个 label 大写,而另一些则只有第一个字母。 I want know how I can recognize the spelling and change my tab label to the same case.我想知道如何识别拼写并将我的标签 label 更改为相同的大小写。

在此处输入图像描述

You already have an XML file containing your ribbon, right?您已经有一个包含您的功能区的 XML 文件,对吧? If so, I think your best bet is just to go there, look for your tab element and manually change the text in the label attribute to all uppercase letters.如果是这样,我认为你最好的选择就是 go 那里,寻找你的标签元素并手动将 label 属性中的文本更改为所有大写字母。
While it may not be a particularly elegant solution, it should do the job just fine.虽然它可能不是一个特别优雅的解决方案,但它应该可以很好地完成工作。 Only downside I can spot is that your ribbon will also appear in all caps if you go to 'Customize Ribbon' in the settings.我能发现的唯一缺点是,如果您在设置中将 go 设置为“自定义功能区”,您的功能区也会全部大写。

With this this.Application.Version you cab check the word version.使用this.Application.Version ,您可以检查单词版本。 The only thing I am doing then is checking if the version is older than 2013:我唯一要做的就是检查版本是否早于 2013:

if (Convert.ToDouble(this.Application.Version) > 150)
{
    Globals.Ribbons.MyRibbon.WinWorker.Label = "lowercase";
}
else
{
    Globals.Ribbons.MyRibbon.WinWorker.Label = "UPPERCASE";
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM