Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word 2010 create macro to draw a line with arrow head 1

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
US
using the record macro button does nothing anymore?
I want to click a quick access toobar button and have it start the "Arrow" comannd just like clicking the
Insert Tab on the ribbon then Shapes then Arrow

So I have no idea where to start.


DougP
 
Hi Doug,

I just managed to do it like this:
Code:
Set sh = ActiveDocument.Shapes.AddLine(10, 10, 100, 10)
sh.Line.EndArrowheadStyle = msoArrowheadTriangle

Remains the coordinates problem of course.

CHeers,
MakeItSo

“Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family.” (Kofi Annan)
Oppose SOPA, PIPA, ACTA; measures to curb freedom of information under whatever name whatsoever.
 
Oooops!
Code:
Dim sh As Shape
was missing... [blush]

“Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family.” (Kofi Annan)
Oppose SOPA, PIPA, ACTA; measures to curb freedom of information under whatever name whatsoever.
 
SWEET
I added a width and I like the bigger head
and made freh line diagonal since that about what I do 90% of the time
Code:
Sub CreateArrowLine()
    Dim sh As Shape
    Set sh = ActiveDocument.Shapes.AddLine(10, 10, 100, 100)
    sh.Line.Weight = 2
    sh.Line.EndArrowheadStyle = msoArrowheadOpen
    ' = msoArrowheadTriangle
End Sub

DougP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top