CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2001
    Posts
    9

    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


  2. #2
    Join Date
    Jan 2001
    Posts
    22

    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


  3. #3
    Join Date
    Mar 2001
    Posts
    9

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured