From c5c341951bcb3629431b40566718d157b99beea9 Mon Sep 17 00:00:00 2001 From: macio Date: Wed, 11 Aug 2021 14:10:12 +0200 Subject: [PATCH] Fixed incorrect document directory In previous code files were not copied into 'ExampleOutput' directory, and it caused 'System.IO.FileNotFoundException: 'Could not find document' error while trying to open files from 'ExampleOutput' directory. --- OpenXmlPowerToolsExamples/TextReplacer02/TextReplacer02.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenXmlPowerToolsExamples/TextReplacer02/TextReplacer02.cs b/OpenXmlPowerToolsExamples/TextReplacer02/TextReplacer02.cs index 7071816b..4737dd82 100644 --- a/OpenXmlPowerToolsExamples/TextReplacer02/TextReplacer02.cs +++ b/OpenXmlPowerToolsExamples/TextReplacer02/TextReplacer02.cs @@ -20,7 +20,7 @@ static void Main(string[] args) var tempDi = new DirectoryInfo(string.Format("ExampleOutput-{0:00}-{1:00}-{2:00}-{3:00}{4:00}{5:00}", n.Year - 2000, n.Month, n.Day, n.Hour, n.Minute, n.Second)); tempDi.Create(); - DirectoryInfo di2 = new DirectoryInfo("../../"); + DirectoryInfo di2 = new DirectoryInfo("../../../"); foreach (var file in di2.GetFiles("*.docx")) file.CopyTo(Path.Combine(tempDi.FullName, file.Name));