JFrye
asked on
VB6 Batch-type file?
Is there a way to make an EXE in VB6 that is similar to a DOS batch file?
I have a few different DOC files that I want to open all at once, but the batch file I made will only open one at a time (open file1, close file1 and open file2, etc.).
If it's possible to do, can you point me in the right direction, please? Thanks guys, and girls!
I have a few different DOC files that I want to open all at once, but the batch file I made will only open one at a time (open file1, close file1 and open file2, etc.).
If it's possible to do, can you point me in the right direction, please? Thanks guys, and girls!
ASKER
Ok, and one more question: For this EXE, if the DOCs are in the same folder as the EXE, can I just put "file1.doc" or will I need "c:\files\galore\file1.doc "?
You can use:
OpenDoc App.Path & "\file1.doc"
OpenDoc App.Path & "\file1.doc"
ASKER
Well, that didn't work. It seems that the file is opened, however Word never opens to actually view the files.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Fantastic! Kudos and 50 points for you!!!
Glad it worked.
OpenDoc "c:\my documents\address labels.doc"
Private Function OpenDoc(fileName As String)
Me.MousePointer = vbHourglass
DoEvents
Dim MSWordApp, MSWordDoc As Object
On Error Resume Next
Set MSWordApp = GetObject(, "Word.Application")
If Err.Number <> 0 Then
Set MSWordApp = CreateObject("Word.Applica
End If
Set MSWordDoc = MSWordApp.Documents.Open(f
MSWordApp.Activate
MSWordApp.WindowState = 1
Set MSWordDoc = Nothing
Set MSWordApp = Nothing
Me.MousePointer = vbDefault
End Function