如何在BULK操作中为不同的单元格设置不同的字体属性 [英] How to set different font attributes for different cells in BULK operation

查看:69
本文介绍了如何在BULK操作中为不同的单元格设置不同的字体属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在BULK操作中为不同的单元格设置不同的字体属性?我已经使用COleSafeArray批量发送TEXT数据到excel,但是safearray不能用于为每个单独的单元格设置单独的foint。

How to set different font attributes for different cells in BULK operation? I have used COleSafeArray for sending TEXT data in bulk to excel, but safearray cannot be used for setting separate foint for each individual cell.

请指教。

 

感谢

Pervez

推荐答案

Pervez,我相信你正在使用C#?如果我正确理解了您的查询,则可以通过将相关单元格声明为范围然后应用属性来为不同单元格设置不同的字体属性。请看这个例子。

Pervez, I believe you are using C#? If I understand your query correctly then you can set different font attributes for different cells by declaring the relevant cells as a range and then applying the properties. Please see this example.


  //~~> Set the Range as A1 to A100
  Excel.Range range = xlWorkSheet.get_Range("A1", "A100");

  range.Font.Name = "Time New Roman";
  range.Font.Size = 10;
  range.Font.ColorIndex = 3;


这篇关于如何在BULK操作中为不同的单元格设置不同的字体属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆