Create a Word doc & Make Current- easy peasy

CadMonkey

Misplaced But Useful
Local time
Today, 15:45
Joined
May 19, 2004
Messages
47
Hola!

Everyone who reads this thread will likely find this the easiest thing in the world to do...

In VBA I have coded to create a new word document. Now I need to make this document I've just crated the active document, so that I can add some text to it. Does anybody know any code that could do this?? This is the code I am currently using:

Dim objapp As Object
Dim ThisDocument As Word.Document
Set objapp = CreateObject("Word.Application")
objapp.Visible = True
objapp.Documents.Add


I owe you big time if you can help me out.
 
Last edited:
Not sure what you mean by "Now I need to make this document I've just created the active document,"

The Code I use to view a word document. This opens the document and sets the focus to it:

Dim objword As Object
Set objword = CreateObject("Word.Application")

objword.Visible = True
objword.Documents.Open (Me.QuoteDocumentPath)

where (Me.QuoteDocumentPath) is the path to the file store in a text field on my form.

Dave
 

Users who are viewing this thread

Back
Top Bottom