![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | unable to catch WordApplication events on vista32 using Wod 2007 My example below is unable to catch WordApplication events, can any one see aproblem with my code. I am attempting to trap the BeforePrint event. cancel = true, then use Envelope.PrintOut Thank you for any help. ' Dim sTo,sFrom sTo = "John Jones" & vbcrlf & "1313 Miller St." & vbcrlf & "Dover, De 19901" sFrom = "Mike Jones" & vbcrlf & "3333 Miller St." & vbcrlf & "Wilmington, De 19954" ' ' set wd = new wrd wd.show wscript.sleep 10000 wd.Quit set wd = nothing ' Class Wrd Dim w,d private sub class_Initialize Set w = wscript.createobject("Word.Application","w_") set d = w.documents.add WScript.ConnectObject d, "d_" d.envelope.insert ,sTo,,,sFrom end sub Sub Show() If Not w is nothing then d.printpreview w.Visible = True w.Activate end if end sub Sub Quit() If Not w is nothing then If w.Visible = True Then w.windowstate = 2 End if w.Quit 0 end if end sub private sub w_NewDocument(Doc) msgbox "w_NewDocument" end sub private sub w_DocumentBeforeClose(Doc, Cancel) msgbox "w_DocumentBeforeClose" end sub private sub w_DocumentBeforePrint(Doc, Cancel) msgbox "w_DocumentBeforePrint" end sub private sub Class_Terminate() set d = nothing If Not w is nothing then w.Quit 0 end if set w = nothing End Sub End Class |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Unable to find BDD 2007 for x64 OS's | Software | |||
| unable to print in Office 2007 | Microsoft Office | |||
| Unable to shutdown after Office 2007 | Vista General | |||