[VB6 ] 開啟檔案路徑的問題
我想做一個程式用來開啟檔案並列印後關閉
寫好後轉成執行檔放在檔案資料夾外,但執行程式開啟檔案時都顯示
找不到檔案C:\windows\system32\0.doc
但我路徑並沒有這樣寫,我只想開啟資料夾內的0.doc
資料夾內包含: 程式與檔案資料夾 , 而程式是開啟檔案資料夾內的檔案
----------
Private Declare Function ShellExecute Lib "shell32.dll" Alias
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal
lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String,
ByVal nShowCmd As Long) As Long
Private Sub Command1_Click()
Dim i As Integer
For i = 0 To 5
If Check1(i).Value = 1 Then
Dim temp As Object
Dim S As String
S = (i) & ".doc"
Set temp = CreateObject("Word.Application")
temp.Documents.Open (S)
DoEvents
temp.Application.PrintOut
temp.quit
Set temp = Nothing
End If
Next i
End Sub
---------------------------------
因本人還在學習階段,可能有些地方寫的不是很好,希望各位幫忙解答,非常謝謝大家!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 111.253.109.216
→
12/23 20:32, , 1F
12/23 20:32, 1F
→
12/23 20:54, , 2F
12/23 20:54, 2F