A
Android
Hi,
Could someone please advise me on opening existing Word
documents.
I have the following macro in an Excel file. I want to
open a Word documents & do stuff with them. Can't seem to
be able to open it.
This version (of many) gives no errors, but also does not
open my files.
What am I missing???
Regards,
Android.
----------------------------------------
Private Sub Workbook_Open()
Dim i As Integer
Dim ProjectsList(2) As String
Dim oWord As Word.Application
Dim WordWasNotRunning As Boolean
Dim oDoc As Word.Document
Dim myDialog As Word.Dialog
Dim UserButton As Long
Set oWord = GetObject(, "Word.Application")
FoundFileIndex = 2
ProjectsList(1) = "C:\Test\TestDoc1.doc"
ProjectsList(2) = "C:\Test\TestDoc1.doc"
For i = 1 To FoundFileIndex
Set oDoc = oWord.Documents.Open(ProjectsList(i))
Next i
Set oDoc = Nothing
Set oWord = Nothing
End Sub
Could someone please advise me on opening existing Word
documents.
I have the following macro in an Excel file. I want to
open a Word documents & do stuff with them. Can't seem to
be able to open it.
This version (of many) gives no errors, but also does not
open my files.
What am I missing???
Regards,
Android.
----------------------------------------
Private Sub Workbook_Open()
Dim i As Integer
Dim ProjectsList(2) As String
Dim oWord As Word.Application
Dim WordWasNotRunning As Boolean
Dim oDoc As Word.Document
Dim myDialog As Word.Dialog
Dim UserButton As Long
Set oWord = GetObject(, "Word.Application")
FoundFileIndex = 2
ProjectsList(1) = "C:\Test\TestDoc1.doc"
ProjectsList(2) = "C:\Test\TestDoc1.doc"
For i = 1 To FoundFileIndex
Set oDoc = oWord.Documents.Open(ProjectsList(i))
Next i
Set oDoc = Nothing
Set oWord = Nothing
End Sub