Open Word Template as an embedded resource

J

jonathan

Hi,

I have a Word Template(.dot) file that i embed in my application. But
for some reason I am not able to load it programmatically.

object missing = System.Reflection.Missing.Value;

string dataPath = @"\Data\MyTemplate.dot";
object oDataPath = dataPath as object;

Word.ApplicationClass wordApp = new
Word.ApplicationClass();
Document contractDocument = wordApp.Documents.Add(ref
oDataPath,
ref missing, ref
missing, ref missing);


after this snipit is run 'contractDocument' is null.

Note: when I use DirectoryInfo and File info to inspect the path, the
template exists.

Note: using Mircosoft.Office.Interop.Word v 8.3.0.0

Any ideas? Thanks alot.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top