Excel text import wizard defaults7/3/2023 The following code give you a brief summary of document objects that you can manipulate via VBA. “Thisworkbook.worksheets(2).cells(1,1) = objWord.Documents(WordNam).Sentences(1)” will enable you to extract the first sentence into cell A1 in the second worksheet. You can use Msgbox statement to prompt extracted information or put the extracted information directly into an Excel file. “objWord.Documents(WordNam).Sentences.Count” can enable you to know how many sentences in this word document. For example, “objWord.Documents(WordNam).Path” can retrieve the document’s full pathname. By referring to this page, you can know which objects can be manipulated. ![]() Here is a list of document objects on this web page. ![]() ![]() ObjWord.Quit SaveChanges:=wdDoNotSaveChanges Word document objects
0 Comments
Leave a Reply. |