Format Shape > Text Box > Internal margin

Feb 21, 2012 at 11:47 PM

How do I change the internal margin for text on an ExcelShape?

Kind regards
Michael

Aug 28, 2012 at 2:32 AM

Hi,

you can add this code in ExcelShape.cs

 

        const string TextMarginLeftPath = "xdr:sp/xdr:txBody/a:bodyPr/@lIns";
        /// <summary>
        /// internal text Left margin in pt
        /// </summary>
        public double TextMarginLeft
        {
            get
            {
            	var ins = GetXmlNodeDoubleNull(TextMarginLeftPath);
                return ins.HasValue ? ins.Value / 12700.0 : 3175.0;
            }
            set
            {
                SetXmlNodeString(TextMarginLeftPath, (value * 12700).ToString());
            }
        }

        const string TextMarginTopPath = "xdr:sp/xdr:txBody/a:bodyPr/@tIns";
        /// <summary>
        /// internal text Top margin in pt
        /// </summary>
        public double TextMarginTop
        {
            get
            {
                var ins = GetXmlNodeDoubleNull(TextMarginTopPath);
                return ins.HasValue ? ins.Value / 12700.0 : 3175.0;
            }
            set
            {
                SetXmlNodeString(TextMarginTopPath, (value * 12700).ToString());
            }
        }

        const string TextMarginRightPath = "xdr:sp/xdr:txBody/a:bodyPr/@rIns";
        /// <summary>
        /// internal text Right margin in pt
        /// </summary>
        public double TextMarginRight
        {
            get
            {
                var ins = GetXmlNodeDoubleNull(TextMarginRightPath);
                return ins.HasValue ? ins.Value / 12700.0 : 3175.0;
            }
            set
            {
                SetXmlNodeString(TextMarginRightPath, (value * 12700).ToString());
            }
        }

        const string TextMarginBottomPath = "xdr:sp/xdr:txBody/a:bodyPr/@bIns";
        /// <summary>
        /// internal text Bottom margin in pt
        /// </summary>
        public double TextMarginBottom
        {
            get
            {
                var ins = GetXmlNodeDoubleNull(TextMarginBottomPath);
                return ins.HasValue ? ins.Value / 12700.0 : 3175.0;
            }
            set
            {
                SetXmlNodeString(TextMarginBottomPath, (value * 12700).ToString());
            }
        }

 

 

 

Sep 30, 2012 at 7:14 PM
Edited Sep 30, 2012 at 7:24 PM

Any changes since the 3.1 realesed?