question

MattFitzmaurice-1186 avatar image
0 Votes"
MattFitzmaurice-1186 asked StefanBlom-6438 edited

Determine if Word is in View Side By Side mode

I see that Windows.BreakSideBySide can be used to exit Side-By-Side mode in Word.

How can I determine whether I'm actually in Side-By-Side mode to begin with?

office-vba-dev
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @MattFitzmaurice-1186
As tag "office-word-itpro" focuses more on general issues of Word client, I would remove the tag.
Thanks for your understanding.

0 Votes 0 ·

Will do. Is there a more appropriate tag? I can't see one.

0 Votes 0 ·

1 Answer

StefanBlom-6438 avatar image
0 Votes"
StefanBlom-6438 answered StefanBlom-6438 edited

You can test if there is more than one window open in the Word application, and then you can run the BreakSideBySide method:

 If Application.Windows.Count > 1 Then
 Application.Windows.BreakSideBySide
 End If
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I don't see how this helps. If I have 4 documents open, then the window count will be 4. It doesn't tell me whether Side by Side is in use. I don't actually want to BreakSideBySide. I just want to know if I'm in Side by Side mode.

0 Votes 0 ·
StefanBlom-6438 avatar image StefanBlom-6438 MattFitzmaurice-1186 ·

As far as I know, you can't test for the Side By Side view directly.

What is the end result you are trying to achieve?

0 Votes 0 ·

Yeah, I can't see a way of testing for it either. Sometimes Word can be quite disappointing.

I'm trying to work around an obscure behaviour that I believe is a bug. (And I don't expect we'll be able to fix it)
One of my customers has noticed that the Navigation Pane doesn't work correctly when two documents are Side By Side and my VSTO AddIn is loaded.

My AddIn is causing the problem, however I don't think I'm doing anything wrong..
I have two building block templates. One should only be used for A4 sized documents and the other should only be used for Letter sized documents. I monitor the Document Changed event and unload/load the building block templates as appropriate.
The unloading/loading of the 2 building block templates is causing the issue.

I had hoped that I would be able to detect when the Side By Side view was in use, and stop my code from unloading/loading building block templates.

Seeing as I can't detect the Side By Side view, i'll have to reassess and possibly redesign - Thanks for your help.

0 Votes 0 ·
Show more comments