vb.net2003下面调用interop.word.dll,里面PrintOut(),一直在等待,求高手解答一下小弟,谢谢
Dim objFile As String = Me.m_tifFileDir + "Microsoft Word - " + Me.getShortFileName(Me.getFileNameFromPath(filename)) + ".tif"If File.Exists(objFile) Then
File.Delete(objFile)
End If
Dim app As Word.Application = New Word.Application
Dim doc As Word.Document
app.Visible = True
doc = app.Documents.Open(filename)
doc.PrintOut()//这个函数需要装打印机吗?
Dim i As Integer = 0
While Not File.Exists(objFile)//这个objFile好象一直没有生成,导致一直在循环中,
System.Threading.Thread.Sleep(1000)
i += 1
Me.showMsg("转换文档 [" & filename & "]到" & objFile & "等待中...... [" & i & "]")
If i > Me.m_waitForPrintTimeBySeconds Then
Me.showMsg("转换文档 [" & filename & "]到" & objFile & "等待超时! [" & i & "]")
objFile = ""
Exit While
End If
End While
哪位好心人可以指导一下小弟,我目的是把 Word 转换到tif这种格式那
问题解决必定给分,呵呵 --------------------编程问答-------------------- 将
doc.PrintOut()
改为
doc.SaveAs(objFile)
补充:.NET技术 , VB.NET