以下の内容はhttps://htn20190109.hatenablog.com/entry/2026/03/20/081905より取得しました。


VBA(Word PDF読込)


https://qiita.com/NoguchiMasafumi/items/a9aceab5bb9c4e3caa82


-- 1. 開発タブの挿入でボタンを作成
※ActiveXコントロールのものを使用する

-- 2. デザインモードONで作成したボタンをダブルクリックするとエディタが開くので下記コードを記載。デザインモードOFFで実行

※ 下記設定必要
「Microsoft Word 16.0 Object Library」の参照設定

 

Option Explicit


Private Sub CommandButton1_Click()


'画面を更新しない
Application.ScreenUpdating = False
'確認メッセージを表示しない
Application.DisplayAlerts = False

Dim wd As New Word.Application

If Dir(ThisWorkbook.Path & "\" & "test.txt") <> "" Then
    Kill ThisWorkbook.Path & "\" & "test.txt"
End If


With wd
    .Documents.Add
    .Documents.Open Filename:=ThisWorkbook.Path & "\" & "test.pdf", ReadOnly:=True
    .ActiveDocument.SaveAs2 Filename:=ThisWorkbook.Path & "\" & "test.txt", FileFormat:=wdFormatText
End With

wd.Quit
Set wd = Nothing

 

MsgBox "処理完了"

'確認メッセージを表示する
Application.DisplayAlerts = True
'画面を更新する
Application.ScreenUpdating = True


End Sub




以上の内容はhttps://htn20190109.hatenablog.com/entry/2026/03/20/081905より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14