如何编辑 MS Word 系统宏 [英] How to edit a MS Word system macro

查看:65
本文介绍了如何编辑 MS Word 系统宏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 MS Word for Mac 版本 16.45,主要语言为德语.我想用日语写假名.这可以通过使用语音指南来实现.但是,此功能有一个众所周知的错误(仅在 Word for Mac 中).假名位于汉字的左上方,即使您选择了中心位置.

I use MS Word for Mac Version 16.45 with German as main language. I want to write furigana in Japanese. This is possible by using Phonetic Guides. However, this function has a well known bug (in Word for Mac only ). The furigana are positioned left above the kanji, even if you selected center position.

选择汉字的字段函数,结果为下字符串

Selecting the field function of the kanji results in the lower string

{q \* jc2 \* "Font:UD Digi Kyokasho N-R" \* hps14 \o\ad(\s\up 13(しん),新)}

将末尾的逗号更改为分号并取消选择字段函数会得到正确的结果.

Changing the comma at the very end to a semicolon and deselecting the field function results in the correct result.

VBA 对象目录向我展示了负责的宏是 Range.PhoneticGuide-Methode.在我看来,参数 wdPhoneticGuideAlignmentCenter 设置为错误的值.

The VBA object catalog shows me, that the macro in charge is the Range.PhoneticGuide-Methode. It seems to me, that the parameter wdPhoneticGuideAlignmentCenter is set to a wrong value.

修复这个错误应该没什么大不了的,但是:

Fixing this bug shouldn't be a big deal, but:

是否可以编辑 Range.PhoneticGuide-Methode?我在哪里可以找到 VBA 代码?

Is it possible to edit the Range.PhoneticGuide-Methode? And where can I find the VBA code?

推荐答案

您不能编辑该方法,但可以使用该方法.将以下内容放在 Normal 模板的 VBA 模块中,然后您可以在文档中的选择上执行它.

You can't edit the method but you can use the method. Place the following in a VBA module in your Normal template and then you can execute it on the selection in your document.

Sub PhoneticGuide()
    Selection.Range.PhoneticGuide Text:="tray sheek", _
     Alignment:=wdPhoneticGuideAlignmentCenter, _
     Raise:=11, FontSize:=7
     
    'other alignment options
'     Alignment:=wdPhoneticGuideAlignmentLeft, _
'     Alignment:=wdPhoneticGuideAlignmentOneTwoOne, _
'     Alignment:=wdPhoneticGuideAlignmentRight, _
'     Alignment:=wdPhoneticGuideAlignmentRightVertical, _
'     Alignment:=wdPhoneticGuideAlignmentZeroOneZero, _

End Sub

我提供了可用的对齐选项,您可以通过试验找到适合您的对齐选项.我从以下 Microsoft 文章中复制了基本代码,您可以进一步参考.

I've included the available alignment options that you can experiment with to find the one that works for you. I copied the base code from the following Microsoft article, which you can use for further reference.

https://docs.microsoft.com/en-us/office/vba/api/word.range.phoneticguide

这篇关于如何编辑 MS Word 系统宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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