ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Word doc in listbox (https://www.excelbanter.com/excel-programming/407046-word-doc-listbox.html)

TVK

Word doc in listbox
 
I have created a UserForm with a ComboBox(ComboBox3) and a ListBox(ListBox5).
The ComboBox has several entries in it (ie. 1 2 3 4 5 ...). If I choose 2 I
would like the ListBox to automatically be populated with a specified Word
document.
I'm calling this procedure after I have made my chioce in the ComboBox, this
procedure displays the word document but not in the listbox. It stats a
seperate window with the document displayed. I want to have the file show up
in the listbox as read only.

Sub ListBox5_update()

Set oWord = CreateObject("Word.Application")
oWord.Visible = True
Set WORDObject = oWord.Documents.Open("C:\file.doc")

End Sub

Any help would greatly be appreciated




All times are GMT +1. The time now is 11:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com