Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
数行の短いセルを含むWordのテーブルがあります。そのセルの内容を.txtファイルにコピーして、改行を維持したいと思います。
現在、改行は失われています。Wordテーブルセルの内容:
Alice Bob
VBA文字列の内容:
AliceBob
文字列を取得するためのコードサンプル:
MyString = ActiveDocument.Tables(a).Cell(1, 1).Range.Text
コピーアンドペーストを使用して新しい単語ドキュメントに貼り付け、新しいドキュメントをテキストファイルとして保存することで、問題を解決しました。きちんと整頓されていませんが、状況に十分効果的です。