c# - Setting Word CustomTaskPane Width Dynamically -


i have vsto custom task pane. in code, setting width 306 , appears correctly in word 2010. howevere, in word 2013, of righhand side of pane not visble unless manually drag make wider. note same pc resolution shouldn't factor. feel if increase width in code, not addressing real issue want way set width dynamically. note control being docked against right hand side

mypane.dockposition = office.msoctpdockposition.msoctpdockpositionright;

so see no reason part of should hanging of side of screen. besides, if dock left, still missing righthand side of pane.

im not sure why should need set width in code, thought should pick size set in usercontrol designer, if don't set size in code, width smaller. have played around autosize stuff, got nowhere. feel missing obvious. can advise please?

also side question, custom control title height larger in word 2013 word 2010. can't see anywhere change this.

the reason might because afaik default resolution office 2013 on screen view 16:9 whereas same office 2010 4:3.

i had encountered similar situation (although powerpoint) in default resolution changes depending on whether office 2010 or 2013.

so if hard code size of task pane 2010, guess face facing now(i faced too!).

you might think of dynamically setting width, need 2 things

  1. check office version.this can done follows:

    microsoft.office.interop.word.application appversion = new microsoft.office.interop.word.application(); 
  2. change width dynamically in taskpane.designer.cs class in initializecomponent() method.

but problem can not add custom code in initializecomponent() method, else object not disposed after uninstalling add-in. , instance of word process appear in task manager.

so, suggest set width per looks acceptable in office 2013 , hope won't need drag task-pane in office 2010.

as far second question concerned, think default behavior.

cheers.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -