[英]How do i set VerticalAlignment to bottom for range?
using Microsoft.Office.Interop.Excel;
Range rng = worksheet.UsedRange;
// I found below code but I didn't found ref to both ExcelAlignemt and excel I i missing something which ref required for this //我发现下面的代码,但我没有找到引用ExcelAlignemt和excel我错过了一些需要这样的ref
rng.VerticalAlignment = ExcelAlignment.xlButtom; //or Excel.XlHAlign.xlHAlignLeft
xlHAlignCenter is in Excel namespace: xlHAlignCenter位于Excel命名空间中:
worksheet.get_Range("A1", "A1").Style.HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter;
Now, with your code: 现在,使用您的代码:
rng.Style.VerticalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignLeft;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.