wordpress hit counter
Position of Excel edit window when embedded in Powerpoint Slide - PresentationML - Formats - OpenXML Developer

Position of Excel edit window when embedded in Powerpoint Slide

Formats

Discussions about working with different Open XML Formats

Position of Excel edit window when embedded in Powerpoint Slide

  • rated by 0 users
  • This post has 2 Replies |
  • 1 Follower
  • Hi,

    I am embedding an .xlsx file into my presentation an an Embedded OLE object. I have this working ok, but I am having trouble setting the position of the "editing" window that pops up when the object is activated.

     

    Currently it is popping up above and to the left of the graphic it is linked to, and I would ideally like it to open up at the same X/Y position as the graphic with the same width/height also.

     

    I am using this XML:

    <xml xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:oa="urn:schemas-microsoft-com:office:activation">    <o:shapelayout v:ext="edit" style='position:relative;left:50;top:200;width:99;height:99'>        <o:idmap v:ext="edit" data="1"/>    </o:shapelayout>    <v:shapetype id="_x0000_t75" o:spt="75" o:preferrelative="t" filled="f" stroked="f">        <v:stroke joinstyle="miter"/>        <v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/>        <o:lock v:ext="edit" aspectratio="f"/>    </v:shapetype>    <v:shape id="_x0000_s1026" type="#_x0000_t75" style='position:relative;left:0;top:0;width:[Width];height:[Height]'>        <v:imagedata o:relid="rId1" o:title=""/>    </v:shape></xml>

    When embedding, the [Width] and [Height] dont seem to affect the edit window, more the actual graphic placeholder the excel file is attached to. I have tried adding a "style" attribute to the <o:shapelayout> node but this doesnt seem to have affected anything.

    I am only using this XML when embedding .xlsx files and the rest of my presentation is generated in C#, but the Reflector tool generated this, so I am using it and editing it as I see fit, then applying it like this:

    VmlDrawingPart _vmlDrawingPart = this.SlidePart.AddNewPart<VmlDrawingPart>(GenID(this.SlidePart));
                ImagePart _imagePart = _vmlDrawingPart.AddNewPart<ImagePart>("image/x-emf", "rId1");
                GenerateImagePartContent(_imagePart);
                System.Xml.XmlTextWriter _writer = new System.Xml.XmlTextWriter(_vmlDrawingPart.GetStream(System.IO.FileMode.Create), System.Text.Encoding.UTF8);
                string _vmlXML = WS.SharedResources.Utilities.LoadXmlFile("Xml/VML.xml", false, true);
                _writer.WriteRaw(_vmlXML);
                _writer.Flush();
                _writer.Close();

    Please someone help me!

    Thanks,

    Mike

  • Hi Mike,

    Are you able to get the position of the editing window to be as you wish if you add the Excel workbook by hand?

    -Eric

  • Hi Eric,

    Yes I can. I figure there is a problem with the XML i am feeding into the _vmlDrawingPart object.

    I actually discovered that you can create tables directly in PowerPoint, so my solution was to do that for this client, but it would still be interesting to know where I might be going wrong with the original approach of embedding an Excel file.

    Thanks,

    Mike

Page 1 of 1 (3 items)