problems with word object in vb
Hi guys,
i am trying to create a word object in vb program and save it as .html and then close it..all in non-visual mode...but after saveas is done, when i try to call wdoc.close where wdoc is derived from Word.Application.Documents.Open(..)..the runtime is complaining that the the "property is not available as a document window is not active.." ...
I am java programmer and donno what the hell is this message about...
Any help is appreciate...urgent..
Thanks
Re: problems with word object in vb
I'm not a VBA guru by any means, but when I checked out the macro
that VBA was creating, I got this:
set docu = wdobj.ActiveDocument
docu.SaveAs FileName:="c:\junk\Testmacro.htm", FileFormat:=100, _
LockComments:=false, Password:="", AddToRecentFiles:=true, WritePassword _
:="", ReadOnlyRecommended:=false, EmbedTrueTypeFonts:=false, _
SaveNativePictureFormat:=false, SaveFormsData:=false, SaveAsAOCELetter:= _
false
When I went to close it, I had to
re-establish the document object with:
set docu = wdobj.ActiveDocument
again
try using active document rather than open.
Good Luck
Hope this helps
Re: problems with word object in vb
Thanks J..
Consider me stupid..but how i am gonna get that active object in the first place????
Thanks for the help