Alfredo Luis Torres Serrano
asked on
Word and DAO
Hi experts
I have a problem trying to create a new document object for word processing, there is one object called document in DAO 2.5/3.5 Library and i receive the error "The use of NEW clause is invalid"
How can i solve this?
thanks
I have a problem trying to create a new document object for word processing, there is one object called document in DAO 2.5/3.5 Library and i receive the error "The use of NEW clause is invalid"
How can i solve this?
thanks
ASKER
I know i have a reference to word 8 library
The problem is that in the word 8 library the object document have the same name that a object document in DAO library and i need to use both.
The problem still been that there is a conflict (I Think) with the document object in DAO libary with the document object (same name) in word 8 library.
Thanks
The problem is that in the word 8 library the object document have the same name that a object document in DAO library and i need to use both.
The problem still been that there is a conflict (I Think) with the document object in DAO libary with the document object (same name) in word 8 library.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks that is logical
To create a new document through code you need to include a reference to the Microsoft Word Object Library - the precise version you'll use depends on what version of Office/Word you have. On mine it's version 9 (Office 2000).
You can then create the document by going:
Dim objWordApp As New Word.Application
Dim objNewDocument As Document
Set objNewDocument = objWordApp.Documents.Add
You can then manipulate the document using the objNewDocument object that has been defined.
Hope this helps.
Pete