Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-18-2016, 12:22 PM
Sven62 Sven62 is offline Make read only and being to top Windows 7 64bit Make read only and being to top Office 2010 32bit
Novice
Make read only and being to top
 
Join Date: Nov 2016
Posts: 4
Sven62 is on a distinguished road
Default Make read only and being to top


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
Reply With Quote
  #2  
Old 11-18-2016, 07:55 PM
macropod's Avatar
macropod macropod is offline Make read only and being to top Windows 7 64bit Make read only and being to top Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,341
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try making your Excel form modeless.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 11-19-2016, 05:45 AM
Sven62 Sven62 is offline Make read only and being to top Windows 7 64bit Make read only and being to top Office 2010 32bit
Novice
Make read only and being to top
 
Join Date: Nov 2016
Posts: 4
Sven62 is on a distinguished road
Default

Excellent. How?
Reply With Quote
  #4  
Old 11-19-2016, 05:47 AM
Sven62 Sven62 is offline Make read only and being to top Windows 7 64bit Make read only and being to top Office 2010 32bit
Novice
Make read only and being to top
 
Join Date: Nov 2016
Posts: 4
Sven62 is on a distinguished road
Default

The button or the whole worksheet?
Reply With Quote
  #5  
Old 11-19-2016, 06:48 AM
macropod's Avatar
macropod macropod is offline Make read only and being to top Windows 7 64bit Make read only and being to top Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,341
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #6  
Old 11-19-2016, 06:56 AM
Sven62 Sven62 is offline Make read only and being to top Windows 7 64bit Make read only and being to top Office 2010 32bit
Novice
Make read only and being to top
 
Join Date: Nov 2016
Posts: 4
Sven62 is on a distinguished road
Default

Ok thanks! I will try that on Monday.
Reply With Quote
Reply



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
Make read only and being to top Ifcontains "yes" make A1, B1 , C1 record read only alpha2nl Excel Programming 5 11-08-2016 04:42 AM
Make read only and being to top 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
Make read only and being to top marking email as "read" until email is read on local device. mwomack Outlook 2 07-16-2011 08:21 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:07 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft