Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: WORD


Message #1 by rstrolz@p... on Thu, 20 Jun 2002 17:49:24
hi there

in a VB program i load Word and a doc file.    
i need to know when the loadingprocess is finished!!!!
how i can do this????



Dim objWord As Word.Application
Dim objDocContent As Word.Range

    Set objWord = CreateObject("Word.Application")
    objWord.Visible = True
    objWord.ScreenUpdating = True
    
    sDocName = "c:\temp\test.doc"
    objWord.Documents.Open FileName:=sDocName

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!! I have to wait until it ist loading complete  !!!!!!
!!!!! HOW i know, when the doc is finish loading??? !!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    
      objWord.ActiveWindow.View.ShowFieldCodes = True
      Set objDocContent = objWord.ActiveDocument.Content
    
    With objDocContent.Find
      .ClearFormatting
      .Replacement.ClearFormatting
      .Execute FindText:=mVar.OldLink, _
               ReplaceWith:=mVar.NewLink, _
               Replace:=wdReplaceAll
    End With
    
    With objWord
      .ActiveWindow.View.ShowFieldCodes = False
      .ActiveDocument.Fields.Update
      .ActiveDocument.Close SaveChanges:=wdSaveChanges
    End With


thanxs for Help
Roger

  Return to Index