Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

initialize an ActiveDocument

Status
Not open for further replies.

michaelji

Programmer
Nov 11, 2005
2
US

hi there,

I trying to use ActiveDocument object in my VBA code, however, I have to open a Microsoft Word in background, otherwise, it will returning error saying "Run-time error 492, ActiveDocument component can't create object".

I know it is not a bit deal, but I wonder if there is way to create an ActiveDocument by myself without bothering to run Microsoft Word?

thanks,

Michael
 
Michael,

ActiveDocument is a property of the Application object that returns a Document object. I'm not sure what you are attempting to do, but a Document object cannot exist independently of the application (Word) so you will have to reference or create an instance of Word before working with the ActiveDocument property.


Regards,
Mike
 
I want to know what you think you would have, if you had an ActiveDocument without Word??? What would it look like? No Word interface, no Word menus, no Word toolbars, no Word scrollbars. No Word VBA to run code on.

No.....application, to hold that ActiveDocument. What in fact would be "Active"? ActiveDocument belongs to Word, and Word alone, and without Word, it does not do anything. This is because it references a Word object.

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top