[问题] VBA注解指定粗体字型

楼主: h02158 (阿益)   2019-10-04 14:21:25
软件:Excel
版本:2016
我想在注解的第一行变粗体字,语法如下
Sub COMM()
Set c = Selection
i = 1
For i = 1 To c.Worksheet.Comments.Count
c.Worksheet.Comments(i).Shape.DrawingObject.ShapeRange.Height = 110
c.Worksheet.Comments(i).Shape.DrawingObject.ShapeRange.Width = 200
c.Worksheet.Comments(i).Shape.DrawingObject.Font.Name = "Tahoma"
c.Worksheet.Comments(i).Shape.DrawingObject.Font.Size = 10
c.Worksheet.Comments(i).Shape.DrawingObject.Font.FontStyle = "标准"
c.Worksheet.Comments(i).Shape.DrawingObject.Font.Bold = True
Next i
End Sub
要如何把<b>This text is bold</b>加入到语法里面?
作者: soyoso (我是耀宗)   2019-10-04 14:48:00
内文的font.bold改以...shape.textframe.characters来改第一行变粗体字,开始1,长度就instr找chr(10)的位置,后面一样font.bold =true

Links booklink

Contact Us: admin [ a t ] ucptt.com