你可以通过改变LeaderNote的Position来改变其位置的,下面的VBA代码你可以试试:
Sub ChangeLeaderTextOrientation() Dim oDoc As DrawingDocument Set oDoc = ThisApplication.ActiveDocument Dim oSheet As Sheet Set oSheet = oDoc.ActiveSheet Dim oNote As LeaderNote Set oNote = oSheet.DrawingNotes.LeaderNotes(1) If oNote.Leader.HasRootNode Then Dim oPosition As Point2d Set oPosition = oNote.Leader.RootNode.Position 'Debug.Print oPosition.X & "," & oPosition.Y ' move the text to left oPosition.X = oPosition.X - 0.255 oNote.Position = oPosition ' move the text to right Set oPosition = oNote.Leader.RootNode.Position oPosition.X = oPosition.X + 0.255 oNote.Position = oPosition ' move the text to above Set oPosition = oNote.Leader.RootNode.Position oPosition.Y = oPosition.Y + 0.255 oNote.Position = oPosition ' move the text to bottom Set oPosition = oNote.Leader.RootNode.Position oPosition.Y = oPosition.Y - 0.255 oNote.Position = oPosition Else Call MsgBox("The leader note has no root node.") End If End Sub
我给你的VBA代码就是改变这个文字的位置的,你可以调试一下,它会改变四个方向,所以你需要改成哪个方向要自己先判断一下。