直接用ahk运行下面的vba代码
Sub 粘贴格式文本()
With Selection
.CopyFormat
.PasteAndFormat (wdFormatSurroundingFormattingWithEmphasis)
.PasteFormat
With .Find
.Text = ” ”
.Replacement.Text = “”
.Forward = True
.Wrap = wdFindStop
.Execute Replace:=wdReplaceAll
End With
End With
End Sub
而不是引用宏
!a::ComObjActive(“word.application”).run(“粘贴格式文本”)