看板 Visual_Basic 關於我們 聯絡資訊
這是我在書上看到的一段程式 他是背景列印的程式 Dim WordApp As Word.Application Dim thisDoc As Document Dim prnTime As Date Dim breakLoop As Boolean Set WordApp = CreateObject("Word.Application") WordApp.Visible = False Wordpp.Document.open ("C:\新增.doc") thisDoc.PrintOut True, True prnTime = Time breakLoop = False While WordApp.BackgroundPrintingStatus <> 0 And Not breakLoop If Minute(Time - prnTime) > 1 Then Reply = MsgBox("Word is takeing too long to print." & vbCrLf & "Do you want to quit?", vbTesNo) If Reply = vbYes Then breakLoop = True Else prnTime = Time End If End If Wend WordApp.Quit MsgBox "Document saved and printed!" 但是拿下去測試 卻不能成功編譯 後來我有修改過 能成功編譯 WORD檔也打得開 只是卡在thisDoc.PrintOut True, True這邊 是哪裡出問題了!?我找了很多本書也沒講到背景列印的方法 請各位板大幫忙看一下吧! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.127.70.37
m9556:thisDoc.PrintOut <<我在猜可能是有Function,找找原來PO的 03/06 09:40