我正在使用此宏編輯從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
任何幫助非常讚賞,
感謝