I have about 100 word (Doc, docx) files and need to extract a particular section. 2.9: Address. This "section" is in the Table of Contents as well as within the document. How can i find and extract this section using vba, macro or python etc.
Microsoft WordVisual Basic ClassicProgramming
Last Comment
Anastasia D. Gavanas
8/22/2022 - Mon
GrahamSkan
Presumably the 'section' begins with an automatically-numbered Heading 2 paragraph with the text "Address". What defines the section end?
forumware
ASKER
The next section also starts with Heading 2 but varies, some is general information, interconnections, logical diagrams.
xtermie is right. There is no built-in procedure to export a Word document to a CSV file. It does exist in Excel and Access because those applications deal exclusively with data in a table format.
The new task, therefore is to fit the data to a table. Then it can be converted to comma-separated text and saved as a text file.
Anastasia D. Gavanas
Graham, I think it would it be easier to copy-paste the particular text into an Excel file and then save the Excel file in a .csv format. What do you think? If we change that in your macro, everything should work exactly as forumware wants.