2013-02-08 56 views
0
foreach (PowerPoint.AnimationSettings animation in currentslide.Shapes) 
{ 
    getAnimation(ref XmlTextWriter xmlcreate, PowerPoint.Shape shape, int i) 
} 

private void getAnimation(ref XmlTextWriter xmlcreate, PowerPoint.Shape shape, int i) 
    { 
     xmlcreate.WriteStartElement("animation",""); //<animation id="Animasyon8" type="Animasyon" userfriendlyindex="2"> 
     xmlcreate.WriteAttributeString("id", "animasyon" + shape.Id); 
     xmlcreate.WriteAttributeString("type", "animasyon"); 
     xmlcreate.WriteAttributeString("userfriendlyindex", i.ToString()); 
     xmlcreate.WriteElementString("duration", "1");   //<duration>1</duration> 
     xmlcreate.WriteElementString("start", "0");//<start>0</start> 
     xmlcreate.WriteElementString("easing", "back");//<easing>back</easing> 
     xmlcreate.WriteElementString("media", shape.Id.ToString());//<media>7</media> 
     xmlcreate.WriteElementString("firstpositionx", shape.TextFrame2.MarginLeft.ToString());//<firstpositionx>206</firstpositionx> 
     xmlcreate.WriteElementString("firstpositiony", shape.TextFrame2.MarginBottom.ToString());//<firstpositiony>64</firstpositiony> 
     xmlcreate.WriteElementString("lastpositionx", "206");//<lastpositionx>206</lastpositionx> 
     xmlcreate.WriteElementString("lastpositiony", "64");//<lastpositiony>64</lastpositiony> 
     xmlcreate.WriteElementString("firstwidth",shape.Width.ToString());//<firstwidth>286</firstwidth> 
     xmlcreate.WriteElementString("firstheight",shape.Height.ToString());//<firstheight>115</firstheight> 
     xmlcreate.WriteElementString("firstalpha", "0");//<firstalpha>0</firstalpha> 
     xmlcreate.WriteElementString("lastwidth","286");//<lastwidth>286</lastwidth> 
     xmlcreate.WriteElementString("lastheight", "115");//<lastheight>115</lastheight> 
     xmlcreate.WriteElementString("lastalpha", "1");//<lastalpha>1</lastalpha> 
     xmlcreate.WriteEndElement();//</animation> 
    } 

我怎樣才能得到這些種類的信息(firstpositionx,firstpositiony,lastpositionx,lastpositiony,firstheight,firstwidth,lastheight,lastwidth,firstalpha和lastalpha),以從PowerPoint形狀插入我的xml文檔?如何獲得Powerpoint形狀的動畫屬性?

+0

是否有任何人幫助我嗎? – mtinyavuz 2013-02-09 23:08:32

回答