Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 03-13-2022, 05:03 PM
macropod's Avatar
macropod macropod is offline Macro to insert shape Windows 10 Macro to insert shape Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,384
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Here is some code to get you started:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim Shp As Shape, Rng As Range, Hght As Single, Wdth As Single
Hght = InchesToPoints(0.5):  Wdth = InchesToPoints(2)
With ActiveDocument
  Set Rng = Selection.Range.Characters.First
  Set Shp = .Shapes.AddShape(Type:=msoShapeRectangularCallout, _
    Left:=Rng.Information(wdHorizontalPositionRelativeToPage), _
    Top:=Rng.Information(wdVerticalPositionRelativeToPage) - Hght, _
    Width:=Wdth, Height:=Hght, Anchor:=Rng)
  .Tables.Add Range:=Shp.TextFrame.TextRange, Numrows:=1, numcolumns:=2
  Shp.TextFrame.TextRange.Characters.Last.Font.Hidden = True
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to insert shape Word 2016 how to insert a text shape into a word doc ? zillah Word 2 11-14-2019 03:27 AM
Add a macro to a shape guest_gast Word VBA 12 07-07-2018 02:20 AM
Assign Macro to Shape in Word 2013 tunes10590 Word VBA 8 01-29-2015 06:26 AM
Macro to insert shape Easy means to access/insert frequently used Shape rdy4trvl Drawing and Graphics 5 09-16-2012 08:12 AM
Run Macro & Activate shape ibrahimaa Excel Programming 1 01-21-2012 02:14 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:02 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft