Hi, I have what i believe to be a simple problem (for real programmers). So any help would be greatly appriciated. I have some code that will open a word document as follows:
Private Sub cmdOpenWord_Click()
Dim wordApp As Word.Application
Dim wordDoc As Word.Document
Set wordApp = New Word.Application
With wordApp
.Visible = True
Set wordDoc = .Documents.Open("G:\Computair\21584-rm-pack.doc", , False)
End With
End Sub
This works a treat but i would like to open a document based on a list box selection. My listbox is called lstQuotes and the field i want to reference is called OrderNo.
So in place of "21584" i would like to reference the number from my list box selection.
Also without pushing too can I create an if statement that would open the document "NoDrawing.doc" (same location) if the select numbers document does not exist.
Any help on this would be great.
Thanking you.
Sean
Private Sub cmdOpenWord_Click()
Dim wordApp As Word.Application
Dim wordDoc As Word.Document
Set wordApp = New Word.Application
With wordApp
.Visible = True
Set wordDoc = .Documents.Open("G:\Computair\21584-rm-pack.doc", , False)
End With
End Sub
This works a treat but i would like to open a document based on a list box selection. My listbox is called lstQuotes and the field i want to reference is called OrderNo.
So in place of "21584" i would like to reference the number from my list box selection.
Also without pushing too can I create an if statement that would open the document "NoDrawing.doc" (same location) if the select numbers document does not exist.
Any help on this would be great.
Thanking you.
Sean