Help get me started with Word automation.

dchapin

New member
Joined
Sep 18, 2008
Messages
4
Programming Experience
Beginner
I am new to Visual Studio 2008. I am trying to use vb.net to open MSWord. I am using late binding. I have the following code which simply opens a new document.

Dim oWord As Object
oWord = CreateObject("Word.Application")
oWord.Visible = True
oWord.Documents.Add()

This works fine. I have a global template that I have in my Word Startup directory. It loads every time word loads. I want to have Word open, as above from my .net app and apply the template. I cant seem to get my head around if I need to write something to copy the .dot file into startup before launching word. I want my template functionality and toolbars available in word if it is launched from my vb.net app but not available if someone just opens word. I'm guessing this is possible but have no clue where to begin.

Any help would be great!

Dan
 
Back
Top