更改Microsoft Word中的Tab键操作。

huangapple go评论86阅读模式
英文:

Change action of Tab in Microsoft Word

问题

请帮忙,我需要在按下Tab键时换行,类似于按下下方向键。有什么办法可以实现吗?

我尝试使用自动更正,但我不知道如何表示Tab字符。

英文:

Please help, I need that when i press the tab key to move to a new line, similar to pressing the down key. Any ideas how to do it?

I tried to use autocorrect, but I don't know how to denote the tab character.

答案1

得分: 0

Here's the corrected version of your text with grammar and punctuation corrections:

"If you want to save a macro in Normal.dotm, you should run the sub in its modules, not in a document's modules. If you run this sub in some document, and the Sub TabisDown() is there, then the saved sub will be the one saved in that document, not in the Normal.dotm. Then, you have to open this document every time, or the shortcut will be set but the Sub TabisDown() will not be found, resulting in pressing the tab key and nothing happening. Alternatively, you can rename the TabisDown sub to a specific name to prevent name conflict with the name in a .docm document file."

英文:

How about this:

Just run the Sub ShortcutKeys() should be done.

Sub TabisDown()
    Selection.MoveDown
End Sub
Rem assign the shortcut key tab(wdKeyTab) to the active Document to run TabisDoow sub which just do what the down key do
Sub ShortcutKeys()
    'if below line use NormalTemplate ,then you should add the Sub TabisDown() code above
    ' to your Normal.dotm Templates which is locate in the directory whose address is "%AppData%\Microsoft\Templates"
    ' or you use ActiveDocument instead to save the two sub code in a .docm document.
    ' the first way it will appact/apply on/to all documents,the other just on/to the document where the code is saved
    CustomizationContext = ActiveDocument 'NormalTemplate 
  '  ThisDocument
    KeyBindings.Add _
        KeyCategory:=wdKeyCategoryCommand, _
        Command:="TabisDown", _
        KeyCode:=BuildKeyCode(wdKeyTab)
End Sub

remark where to save and when to run is matter

If you want to save in Normal.dotm you should run the sub in it's modules, not in a document's modules. If you run this sub in some document ,and the Sub TabisDown() is there, then the saved sub will be the one saved in that documents,not in the Normal.dotm, then you have to open this document in every time, or the shortcut will be set , but the Sub TabisDown() will not be found, this results in pressing tab key and nothing happen. Or you can rename the TabisDown sub to a specific name to prevent that name conflict with the name in a .docm document file.

YouChat help me a corrected version of my text above with grammar and punctuation corrections:

> If you want to save a macro in Normal.dotm, you should run the sub in its modules, not in a document's modules. If you run this sub in some document, and the Sub TabisDown() is there, then the saved sub will be the one saved in that document, not in the Normal.dotm. Then, you have to open this document every time, or the shortcut will be set but the Sub TabisDown() will not be found, resulting in pressing the tab key and nothing happening. Alternatively, you can rename the TabisDown sub to a specific name to prevent name conflict with the name in a .docm document file.

huangapple
  • 本文由 发表于 2023年5月14日 05:59:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/76245048.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定