我正在尝试在vba中创建一个宏来做标题所说的事情(我认为它很清楚)。我不知道该使用哪些函数。
这就是我要找的(部分):
Sub FormatForWhatsapp()
With Selection.Find
.ClearFormatting
.Font.Bold = True
.Text = ""
.Replacement.Text = "*^&*"
.Forward = True
.Wrap = wdFindContinue
.Format = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.ClearFormatting
.Font.Italic = True
.Text = ""
.Replacement.Text = "_^&_"
.Forward = True
.Wrap = wdFindContinue
.Format = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub我的问题是: 1)我需要一个本机代码,而不是Office的"Find“函数。2)我还需要一个代码,做相反的行动,重新格式化回到word。
提前感谢
发布于 2017-05-16 13:46:51
这是我的宏代码!只需创建View Makros,然后编辑并粘贴我的代码即可!
Bold für应用程序:
Sub bold()
'
' bold Makro
' Wahtsapp bold
'
' Tastenkombination: Strg+b
'
ActiveCell.FormulaR1C1 = "*" & ActiveCell.FormulaR1C1 & "*"
End Sub斜体für Whatsapp:
Sub Italic()
'
' Italic Makro
' Whatsapp Italic
'
' Tastenkombination: Strg+i
'
ActiveCell.FormulaR1C1 = "_" & ActiveCell.FormulaR1C1 & "_"
End Subhttps://stackoverflow.com/questions/43993216
复制相似问题