A
awakeSecret52
I am trying to create a Document Level office 2k7 project.
my objective is write a code in startup event of ThisDocument which will
load all content of another document say doc2.docx.
following is code I am writing
object file = "D:\\Documents and Settings\\Admin\\My Documents\\Visual
Studio 2008\\Projects\\WordDocument\\OpenContent\\Docs\\Don.docx";
object nullobj = System.Reflection.Missing.Value;
Word.Document doc = Application.Documents.Open(ref file, ref
nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref
nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref
nullobj, ref nullobj, ref nullobj);
Globals.ThisDocument.Content.Text = doc.Content.Text;
doc.Close(ref nullobj,ref nullobj,ref nullobj);
which is not really good way of programming I thnk.
I have to open new word document, load its content to current document and
close it.
what I want is..
in startup event...
I want to have loaded content of doc2.docx directly into
ThisDocument.content.text
I dont want to use another Document object.
How do I do it?
please send me as soon as possivle
my objective is write a code in startup event of ThisDocument which will
load all content of another document say doc2.docx.
following is code I am writing
object file = "D:\\Documents and Settings\\Admin\\My Documents\\Visual
Studio 2008\\Projects\\WordDocument\\OpenContent\\Docs\\Don.docx";
object nullobj = System.Reflection.Missing.Value;
Word.Document doc = Application.Documents.Open(ref file, ref
nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref
nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref
nullobj, ref nullobj, ref nullobj);
Globals.ThisDocument.Content.Text = doc.Content.Text;
doc.Close(ref nullobj,ref nullobj,ref nullobj);
which is not really good way of programming I thnk.
I have to open new word document, load its content to current document and
close it.
what I want is..
in startup event...
I want to have loaded content of doc2.docx directly into
ThisDocument.content.text
I dont want to use another Document object.
How do I do it?
please send me as soon as possivle