Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

vsto - Open XML SDK - Adding a macro programatically to a Word 2007 document -


i trying dynamically add new custom ribbon in word 2007 document following teh manual method described in article :- http://msdn.microsoft.com/en-us/library/aa338202(v=office.12).aspx.

the article specifies following :-

a) create xml file named customui.xml contain elements want display in tab , put same in folder named customui.

b) rename word 2007 document .zip. add above "customui" folder zip file.

c) add following relationship "_rels/rels" file in .zip file :-

<relationship type="http://schemas.microsoft.com/office/2006/   relationships/ui/extensibility" target="/customui/customui.xml"    id="customuirelid" /> 

do have code sample achieve same using openxml sdk? example, how add "ribbonextensibilitypart" (which contains ribbon xml) document?

edit :-

this how did above mentioned steps:-

 string documentfilename = <path of docx file>;   string ribbonxml        =  <path of ribbon xml file>;  using (wordprocessingdocument mydoc = wordprocessingdocument.open(documentfilename, true))  {    maindocumentpart mainpart = mydoc.maindocumentpart;     if (mydoc.getpartscountoftype<ribbonextensibilitypart>() > 0)       mydoc.deletepart(mydoc.getpartsoftype<ribbonextensibilitypart>().first());     ribbonextensibilitypart ribbonextensibilitypart = mydoc.addnewpart<ribbonextensibilitypart>();    ribbonextensibilitypart.customui = new documentformat.openxml.office.customui.customui(file.readalltext(ribbonxml));     mydoc.createrelationshiptopart(ribbonextensibilitypart);  } 

and able see new ribbon elements in it. however, have buttons in ribbon , want add handle actions on buttons. following ribbon xml looks :-

<customui xmlns="http://schemas.microsoft.com/office/2006/01/customui">   <ribbon>     <tabs>       <tab id="customtab" label="my tab">         <group id="mygroup" label="my group" >           <button id="button1" label="my large button"              size="large"/>           <button id="button2" label="my normal button"              size="normal" *onaction="thisdocument.myotherbuttonmacro"* />         </group >       </tab>     </tabs>   </ribbon> </customui> 

have @ "onaction="thisdocument.myotherbuttonmacro". know can write macro function in document. however, custom ribbon added dynamically on server-side, not sure how can add macro dynamically. help?


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -