![]() |
|
|
|
#1
|
|||
|
|||
|
The code below opens the file as read only.
How can I make it also bring that Word doc to the top? Right now it opens behind the excel file where my form button resides. Code:
Sub OpenWord()
Dim WordApp As Object
Dim WordDoc As Object
Set WordApp = CreateObject("Word.Application")
Set WordDoc = WordApp.Documents.Open(Filename:="C:\test\test.doc", ReadOnly:=True)
WordApp.Visible = True
'do your stuff
Set WordDoc = Nothing
Set WordApp = Nothing
End Sub
|
|
#2
|
||||
|
||||
|
Try making your Excel form modeless.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#3
|
|||
|
|||
|
Excellent. How?
|
|
#4
|
|||
|
|||
|
The button or the whole worksheet?
|
|
#5
|
||||
|
||||
|
As indicated in my previous reply, you make the userform modeless. If you examine the userform's properties, you'll see that it has one named 'ShowModal'. Simply set that to False. Do note that this also means your worksheets & workbooks will be accessible while the userform is in use.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#6
|
|||
|
|||
|
Ok thanks! I will try that on Monday.
|
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Outlook sending Not Read receipt when read receipts are disabled | abrown1983 | Outlook | 1 | 07-16-2021 04:33 AM |
Ifcontains "yes" make A1, B1 , C1 record read only
|
alpha2nl | Excel Programming | 5 | 11-08-2016 04:42 AM |
Automatically enter date into a column and make that column read only
|
Mr Davo | Excel | 1 | 10-29-2012 01:07 AM |
| Is it possible to make Word link to the last record in Excel | stephen_pen | Word | 0 | 09-22-2011 11:00 PM |
marking email as "read" until email is read on local device.
|
mwomack | Outlook | 2 | 07-16-2011 08:21 PM |