英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论