![]() |
|
![]() |
|
Thread Tools | Display Modes |
|
#1
|
||||
|
||||
![]()
For Word documents, try:
Code:
Sub CollateDocumentData() Application.ScreenUpdating = False Dim strFolder As String, strFile As String, strDocNm As String, strTmp As String, strOut As String Dim wdDoc As Document, i As Long: Const StrFnd As String = "storage,dry,spent,ISFSI,fuel" strDocNm = ActiveDocument.FullName strFolder = GetFolder: If strFolder = "" Then Exit Sub strFile = Dir(strFolder & "\*.doc", vbNormal) to: strFile = Dir(strFolder & "\*.pdf", vbNormal) For PC macro installation & usage instructions, see: http://www.gmayor.com/installing_macro.htm
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#2
|
|||
|
|||
![]()
how do i run the same vba in excel ? also, how do i loop through sub-folders within a folder? thanks.
|
#3
|
||||
|
||||
![]()
You don't - the code would have to be completely re-written to be run from Excel.
Quote:
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Hoxton118 | Word VBA | 4 | 04-04-2021 06:02 AM |
search on multiple word documents | Guy Roth | Word | 7 | 03-06-2017 01:31 PM |
![]() |
mariur89 | Excel | 4 | 12-14-2014 01:33 AM |
Multiple words, one search | return2300 | Word VBA | 0 | 08-30-2013 12:26 PM |
![]() |
Rattykins | Word VBA | 4 | 06-27-2012 10:02 PM |