Results 1 to 4 of 4

Thread: Word and VB6 problems

Threaded View

  1. #4

    Thread Starter
    Member
    Join Date
    Sep 2003
    Posts
    35
    I found the below code. Can anyone tell me what this does, and does it do what I want i.e open word, display the print preview, then when the user closes the print preview, automatically close word also...

    Code:
    WordHwnd = FindWindowEx(0&, 0&, "OpusApp", vbNullString)
    
    DocHwnd = FindWindowEx(WordHwnd, 0&, "_WwG", vbNullString)
    
    .
    .
    .
    
    doc.PrintPreview
        
    msword.Visible = True
    
    Do While Not ActiveDocument.Close
    Loop
    
    Do While DocHwnd <> 0
         Ret = WaitForSingleObject(DocHwnd, INFINITE)
    Loop
    
    msword.Quit Savechanges:=wdDoNotSaveChanges
    Set msword = Nothing
    Last edited by raydenl; Apr 12th, 2004 at 08:20 PM.

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