我正在使用此宏编辑从PDF复制和粘贴的文本,以便将其格式化为填充word文档中的整行。MS Word VBA - '正常'格式化未设置并被“标题”格式覆盖
但是,当我粘贴标题上面的行时:Selection.Style = ActiveDocument.Styles("Normal")
不起作用,而文本被格式化为标题。
Sub Clean_PDF_Para()
'crude macro to fix paragraph markers (invisible)(so text copied from pdf is formatted to fill lines
'currently based on selected range
With Selection.Find
.Text = "^p"
.Replacement.Text = " "
.Wrap = wdFindStop ' think this is required to stop it fixing (breaking) the whole selction
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Style = ActiveDocument.Styles("Normal") 'added to fix the paragraph style so it doesn't take the form of a heading.
End Sub
任何帮助非常赞赏,
感谢