“允许文本溢出形状";在Excel 2010 VBA中 [英] "Allow text to overflow shape" in excel 2010 vba

查看:435
本文介绍了“允许文本溢出形状";在Excel 2010 VBA中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

能否请我指出如何定位使用AddShape通过VBA创建的文本框的允许文本溢出形状"?我没有看过对象引用textframe/textframe2.

Could I please be pointed to how I could target the "Allow Text to Overflow Shape" of a Textbox created via VBA using AddShape? I have looked through the object reference textframe/textframe2 with no luck.

这可以在没有vba的情况下实现[但是我有很多文本框],方法是:

This can be achieved without vba[but I have lots of textboxes] by:

右键单击[在文本框形状上] >>设置形状>>文本框>>允许文本溢出形状[在自动调整"组下的勾选框]

right click [on the textbox shape] >> format shape >> textbox >> Allow Text to overflow shape [tick box under the "Autofit" group]

我也没有进行宏录制

建议表示赞赏

推荐答案

您引用的设置似乎会影响Excel对象模型中的两个属性,即TextFrame.HorizontalOverflowTextFrame.VerticalOverflow.

The setting you refer to seem to affect two properties in the Excel object model, TextFrame.HorizontalOverflow and TextFrame.VerticalOverflow.

VerticalOverflow可以设置为:

  • xlOartVerticalOverflowClip-无溢出
  • xlOartVerticalOverflowEllipsis-溢出标记有三个点( ... )
  • xlOartVerticalOverflowOverflow-允许溢出
  • xlOartVerticalOverflowClip - no overflow
  • xlOartVerticalOverflowEllipsis - overflow is marked with three dots (...)
  • xlOartVerticalOverflowOverflow - allows overflow

HorizontalOverflow只能设置为:

  • xlOartHorizontalOverflowClip-无溢出
  • xlOartHorizontalOverflowOverflow-允许溢出
  • xlOartHorizontalOverflowClip - no overflow
  • xlOartHorizontalOverflowOverflow - allows overflow

工作示例(Excel 2010):

Working example (Excel 2010):

Sheet1.Shapes(1).TextFrame.VerticalOverflow = xlOartVerticalOverflowOverflow

编辑:

另请参见MSDN上的文档,其中说 VerticalOverflow 设置仅在AutoSize属性为 False

Also see the documentation at MSDN, where it says that the VerticalOverflow setting only has an effect when the AutoSize property is False, and that the HorizontalOverflow setting only has an effect when the TextFrame2.WordWrap property is msoFalse (0).

这篇关于“允许文本溢出形状";在Excel 2010 VBA中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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