justtrying
07-22-2015, 06:17 AM
I am trying to pull Content Control data from a Word Survey. User will submit completed surveys to a shared folder. I want to automatically pull each document and extract Content Control data into Excel sheet. So far for pulling up files I have the code below. Can someone tell me a way to also generate an ID for each file to put in the first column? Thank you.
Sub PullContentControlDataFromSurvey()
vRow = ActiveSheet.UsedRange.Rows.Count + 2
vColumn = 3
Set fso = New Scripting.FileSystemObject
Set fsDir = fso.GetFolder(inPath)
Set wdApp = New Word.Application
wdApp.Visible = True
For Each fsFile In fsDir.Files
wdApp.Documents.Open (fsFile)
Set myDoc = wdApp.ActiveDocument
Sub PullContentControlDataFromSurvey()
vRow = ActiveSheet.UsedRange.Rows.Count + 2
vColumn = 3
Set fso = New Scripting.FileSystemObject
Set fsDir = fso.GetFolder(inPath)
Set wdApp = New Word.Application
wdApp.Visible = True
For Each fsFile In fsDir.Files
wdApp.Documents.Open (fsFile)
Set myDoc = wdApp.ActiveDocument