Opening and Displaying a word file

AlexSrois

New Member
Joined
Aug 14, 2021
Messages
18
Office Version
  1. 2016
Platform
  1. Windows
Hi guys!
Been lurking around the forums for quite a while and really learned much reading you. Thanks a lot.

I'm usually able to work around my problems after doing some research on the forum, but that problem seems so simple I didn't found the answer yet ;)

I have macro assigned to a button on my spreadsheet. When I click the button, I want it to open a specific word file and to display it. At the moment, I'm able to open the word file but it stays minimise. Any way to solve this?

Here is the code I'm working with at the moment ;

Sub Word()
Set wordapp = CreateObject("word.Application")
wordapp.documents.Open "\\clustered_files.cisssbsl.rtss.qc.ca\utilisateurs$\SIAL0102\Desktop\Notes évolutives\00 - UNSORTED.docx"
wordapp.Visible = True
End Sub

Thank you for your help!
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Try this
VBA Code:
Sub Word()
Set wordapp = CreateObject("word.Application")
wordapp.documents.Open "\\clustered_files.cisssbsl.rtss.qc.ca\utilisateurs$\SIAL0102\Desktop\Notes évolutives\00 - UNSORTED.docx"
wordapp.Visible = True
wordapp.Activate
End Sub
 
Upvote 0
Solution
You can also adjust the window state.

VBA Code:
    With wordapp
        .Activate
        With .ActiveWindow
            .View.Type = 1 'wdNormalView
            .WindowState = 1 'wdWindowStateMaximize
            .ActivePane.View.Zoom.Percentage = 100
            .View.Type = 3 'wdPrintView
        End With
    End With
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,249
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top