私はこのマクロを使用して、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
任意の助けも、