Solarion
Honorary Master
- Joined
- Nov 14, 2012
- Messages
- 28,051
- Reaction score
- 17,804
Word.Document wordDoc = null;
string fileName = "BakeryInvoice.dotx";
string pathtest = Path.Combine(Environment.CurrentDirectory, @"Templates\", fileName);
wordDoc = wordInstance.Documents.Add(pathtest);
pathtest shows as:
"C:\\Users\\XXX\\Desktop\\Baker Test\\ChefApp\\ChefApp\\bin\\Debug\\Templates\\BakeryInvoice.dotx"
And no matter how many different ways I flog this dead horse, it keeps saying : Object reference not set to an instance of an object on this line wordDoc = wordInstance.Documents.Add(pathtest);
Any ideas?
string fileName = "BakeryInvoice.dotx";
string pathtest = Path.Combine(Environment.CurrentDirectory, @"Templates\", fileName);
wordDoc = wordInstance.Documents.Add(pathtest);
pathtest shows as:
"C:\\Users\\XXX\\Desktop\\Baker Test\\ChefApp\\ChefApp\\bin\\Debug\\Templates\\BakeryInvoice.dotx"
And no matter how many different ways I flog this dead horse, it keeps saying : Object reference not set to an instance of an object on this line wordDoc = wordInstance.Documents.Add(pathtest);
Any ideas?