Hello,
I'am trying to use mail merge. I've created a simple tamplate which I have stored in wwwroot directory.
When I'am trying to load this template I recive :
Unhandled exception rendering component: Could not find a part of the path "/wwwroot/data/docio/merge.docx".
System.IO.DirectoryNotFoundException: Could not find a part of the path "/wwwroot/data/docio/merge.docx".
Here is my code sample:
string basePath = @"wwwroot/";
string dataPath = basePath + @"data/docio/merge.docx";
FileStream fileStreamPath = new FileStream(dataPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
WordDocument document = new WordDocument(fileStreamPath, FormatType.Doc);
string[] fieldNames = new string[] { "Id", "FirstName", "LastName" };
string[] fieldValues = new string[] { UserValues.Id.ToString(), UserValues.FirstName.ToString(), UserValues.LastName.ToString() };
....
Could you advaise me somethig?
With best regards
Jarosław Bolejko
Thanks for your quick replay.
As always you are amazing. Thank you!
I've mange to solve the problem. Sometimes before writing a question people (me:D) should take some sleep and rest. My template in wwwroot was field by data (like Firstname: Jarek), it sould be ready to be field by data (like FirstName: <<FirstName>>).
With best regards
J