How can I use word application scope inside for each folder/file in folder?

I have a folder with subfolders named after companies, which each contain their own word doc. I am supposed to extract the data from the word docs into an excel into the subfolders. The word doc’s naming convention is [Company Name] + Form. I am having difficulty with this as word application scope cannot open the individual word docs. Can I have some help please?

Hello @Ivan17 , could you please try this:

  1. Assign the folder path to a variable PATH(Type = array of string) = Directory.GetFiles(“your file path”)
  2. Use a For Each activity for the PATH variable. inside that use word application to open each item.



check this


HI @Ivan17

Try with for each file in folder activity and check on include subfolders

And if you use CurrentFile.ToString it will return you the whole path

Or use like this in for each activity
Directory.GetFiles(“Your Path”,"*.docx",SearchOption.AllDirectories)


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.