Since MS Office 2013, the windows of each Office app run in a single instance of the executable. When an instance opens a new window, Task View first switches to an existing app window. (My other gripe is that multiple UNDO commands backtrack chronologically across multiple windows, which is never what I want.)
Word and Excel
I a résolu le problème in Office 2016 by using ligne de commande options to run each Word and Excel window in a separate instance. For Word, the option is /N; for Excel it is /X. It costs a little extra startup time and a little extra memory. I don't run beaucoup de windows at once, so for me the reduced aggravation is worth it.
For desktop icons, custom toolbars, and other shortcuts, vous pouvez simply edit the properties and add the option to the target ligne de commande:
"C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE" /X "C:\Data\Weather\Weather Log.xls"
Making the option apply when you open a file (e.g. by double-click) is a little harder.
-
Open a command window running as Administrator.
-
Trouvez le type de fichier associated with a extension de fichier:
assoc .xls
.xls=Excel.Sheet.8
- Trouvez le command used to open that type de fichier:
ftype excel.sheet.8
excel.sheet.8="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" "%1"
- Replace that command with one that includes the option:
ftype excel.sheet.8="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
excel.sheet.8="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
- Repeat from step 2 for each extension de fichier you use (e.g. .xlsx). Ones with the same type de fichier need no further change.
You could do a wholesale change by capturing all Excel ftype definitions into a .BAT file, editing the file to add ftype at the start of each line and /X after each .EXE, and (for .BAT scripts) changing %1 to %%1
ftype | find /i "office16\excel" > ftypes.bat
[your text editor] ftypes.bat
(make the changes described above)
Running the resulting script should produce output similar to:
ftypes.bat
ftype dqyfile=C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE /X "%1"
dqyfile=C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE /X "%1"
ftype Excel.Addin="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
Excel.Addin="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
ftype Excel.Backup="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
Excel.Backup="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
ftype Excel.Chart=C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE /X "%1"
Excel.Chart=C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE /X "%1"
ftype Excel.Chart.8="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
Excel.Chart.8="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
ftype Excel.CSV="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
Excel.CSV="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
ftype Excel.Macrosheet="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
Excel.Macrosheet="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
ftype Excel.OpenDocumentSpreadsheet.12="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
Excel.OpenDocumentSpreadsheet.12="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
ftype Excel.Sheet.8="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
Excel.Sheet.8="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
ftype Excel.Sheet.12="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
Excel.Sheet.12="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
ftype Excel.SLK="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
Excel.SLK="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
ftype Excel.Template="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
Excel.Template="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
ftype Excel.Template.8="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
Excel.Template.8="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
ftype Excel.Workspace="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
Excel.Workspace="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
ftype Excel.XLL="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
Excel.XLL="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X "%1"
ftype Excelhtmlfile="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X
Excelhtmlfile="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X
ftype Excelhtmltemplate="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X
Excelhtmltemplate="C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE" /X
ftype iqyfile=C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE /X "%1"
iqyfile=C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE /X "%1"
Other Office Apps
Some Office apps, notably PowerPoint, have no option to start a new instance. Cependant, running an app as a different user creates a new instance. So one workaround is to create local Windows users for as many bureau virtuels as you want to open PowerPoint on concurrently. This scheme is not ideal, because vous devez remember which users/instances you already have running before opening a new one. Si vous avez only a few, it may not be too bad.
To create each user:
Settings > Accounts > Family & Other Users > [+] Add someone else to this PC
Je n'ai pas this person's sign-in information
Add a user without a Microsoft account
Enter new Username, Password, and Security Questions
To create a shortcut which starts PowerPoint as a specified user, edit the shortcut's properties to use a command such as:
runas /user:user2 /savecred "C:\Program Files (x86)\Microsoft Office\root\Office16\POWERPNT.EXE"
runas prompts for the user's password. /savecred saves the password the first time and uses the saved password subsequently. You may want to initially make each shortcut Run: Normal window, and later change it to Run: Minimized.
These shortcuts could be either on the Windows desktop or in a custom toolbar menu. Once PowerPoint is running, vous pouvez either open a PPT file de là, or drag in a file from Explorateur de fichiers. Si vous êtes working on a few PPT files for an extended time, you could create a shortcut for each file, specifying which user to run as.
Opening a PowerPoint Instance from a PPT File
Malheureusement, dragging a PPT file onto one of the desktop shortcuts described above won't work, because runas requires that the full PowerPoint ligne de commande be quoted. Shortcuts for opening a PPT file directly need an intermediate script to sort out the quotes. Create a script such as "PowerPoint_User.bat":
:: Usage: PowerPoint_User <username> <PPT filename>
:: Opens a PPT file as a specified user, starting a new PowerPoint instance on
:: the current virtual desktop if that user was not already running PowerPoint.
:: (%~f2 expands %2 to full path with no quotes. See "call /?".)
@echo off
C:\Windows\System32\runas.exe /user:%1 /savecred "POWERPNT.EXE \"%~f2\""
Then create a shortcut for each user, with a command such as:
C:\bin\PowerPoint_User.bat user2
If the shortcut is on your Windows desktop, then vous pouvez drag a PPT file onto it. If you create the shortcut in %USERPROFILE%\AppData\Roaming\Microsoft\Windows\SendTo, then vous pouvez click right on a PPT file and open it from the "Send to" menu. In either case, remember that each shortcut will prompt for a password the first time it is run.
(If vous devez debug the shortcut, set it to Run: Normal window, prepend cmd /k to the command, and remove @echo off from the script.)