Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #10  
Old 02-24-2025, 11:48 AM
joShu joShu is offline How can I switch to/from "Focus Mode" with VBA? Windows 10 How can I switch to/from "Focus Mode" with VBA? Office 2019
Novice
 
Join Date: Apr 2021
Posts: 2
joShu is on a distinguished road
Default

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
But I have not yet found a similar technique for determining Focus Mode.

The use of ExecuteMso implies there is no object for it?

CommandBars.ExecuteMso method (Office) | Microsoft Learn
Quote:
This method is useful in cases where there is no object model for a particular command.
Reply With Quote
 

Tags
distraction-free, focus mode



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I switch to/from "Focus Mode" with VBA? Remove toggle button "focus" (dotted inner border) using VBA 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
How can I switch to/from "Focus Mode" with VBA? Using "draw"tab crashes word- safe mode fixes temporarily? 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
How can I switch to/from "Focus Mode" with VBA? PPT 2010 Action - Run Program reverses "/" switch character wflett PowerPoint 4 03-17-2015 04:03 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:50 AM.


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