![]() |
#1
|
|||
|
|||
![]()
Hi All,
I would like to switch to "Focus Mode" (Word's distraction-free, full screen view) with VBA code. I've done a bunch of Google searches and have had no luck. Any assistance would be very appreciated. Thanks in advance! MrXDev Last edited by MrXDev; 03-08-2023 at 10:09 AM. Reason: add file |
#2
|
||||
|
||||
![]()
Do you mean reading layout view?
Code:
ActiveWindow.View.ReadingLayout = True
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
|||
|
|||
![]()
Hi. Thanks for the reply.
No, I'm looking for the full-screen, distraction-free editing mode Screen shot: Microsoft services |
#4
|
|||
|
|||
![]()
Hi,
I have the same problem -- can't find a way of entering this view type from VBA. In case it might help others to help us, MrXDev (and I) want to use VBA to get to the view you reach manually in Word when you: -- click on the View tab on the ribbon -- in the Immersive group on the View ribbon, click Focus Can anyone help please? |
#5
|
|||
|
|||
![]()
I haven't been able to figure this out either.
The lines you get if you record a macro don't work for me. Nor does something like Application.CommandBars.ExecuteMso "FocusMode" . The best i have come up with so far is using sendkeys, which is clunky/dicey, but it does mimic the ribbon nav of Alt W O: Code:
SendKeys "%wo" |
#6
|
||||
|
||||
![]()
joshu was very close to hitting the right command name
Code:
Application.CommandBars.ExecuteMso "ViewFocusModeView"
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#7
|
|||
|
|||
![]() Quote:
|
#8
|
||||
|
||||
![]()
Good call
I looked in my Word2016 version of that workbook and it wasn't there. I followed your link and found there is now a Word2019 version available and that command appears in that version.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#9
|
|||
|
|||
![]()
To "Guessed", and everyone else who has contributed so far, thank you for helping by identifying:
Application.CommandBars.ExecuteMso "ViewFocusModeView" and the route to finding it. To get to its neighbour in the "View > Immersive" group (the Immersive Reader view) using VBA, it's the rather more cryptically named: Application.CommandBars.ExecuteMso "ToggleLearningTools" which works in my Office 2021, and might in some earlier versions, too. Last edited by PatrickOfLondon; 05-27-2024 at 01:29 AM. Reason: removing stray comma |
#10
|
|||
|
|||
![]()
Application.CommandBars.ExecuteMso "ViewFocusModeView" was the ticket, thanks Guessed. That is an easy way to toggle Focus Mode.
Now wondering if I can detect which mode I am in (in order to display Nav Pane, change Page Color, etc., based on mode) I know I can do something like this for Print View: Code:
test1 = ActiveWindow.View.Type = wdPrintView The use of ExecuteMso implies there is no object for it? CommandBars.ExecuteMso method (Office) | Microsoft Learn Quote:
|
![]() |
Tags |
distraction-free, focus mode |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Matt C | Excel Programming | 7 | 05-22-2022 04:32 AM |
Excel 2003: VBA "Function" causes "#VALUE!" errors after running "insert/delete row" custom macro | Matt C | Excel Programming | 2 | 01-08-2022 06:03 AM |
![]() |
owl | Drawing and Graphics | 11 | 10-04-2017 10:11 AM |
"one click" function to switch between branded presentations | davidolone | PowerPoint | 0 | 01-16-2016 01:54 PM |
![]() |
wflett | PowerPoint | 4 | 03-17-2015 04:03 AM |