View Single Post
 
Old 04-22-2015, 05:58 AM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,601
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Your code with Graham's revisions inserts a table "AT" a bookmark. If you want to "WRAP" the table "IN" the bookmark use:

Code:
Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey
Dim oRng As Word.Range, oTbl As Word.Table
  Set oRng = ActiveDocument.Range.Bookmarks("InsertDuty").Range
  Set oTbl = ActiveDocument.Tables.Add(Range:=oRng, NumRows:=3, NumColumns:=4)
  ActiveDocument.Bookmarks.Add "InsertDuty", oTbl.Range
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote