Solved

How to insert a table below each graphic inserted into a document?

Posted on 2016-11-08
4
43 Views
Last Modified: 2016-11-09
0
Comment
Question by:Alex972
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 50

Expert Comment

by:Rgonzo1971
ID: 41880094
Hi,

pls try
Sub macro()

For Each shp In ActiveDocument.InlineShapes
    If shp.Type = wdInlineShapePicture Then
        Set rng = shp.Range
        rng.Collapse Direction:=wdCollapseEnd
        rng.InsertParagraph
        rng.InsertParagraph
        Set rng = Range(rng.Start + 2, rng.Start + 2)
        rng.Tables.Add Range:=rng, NumRows:=3, NumColumns:=4
        
    End If
Next
End Sub

Open in new window

Regards
0
 
LVL 1

Author Comment

by:Alex972
ID: 41881244
When I tried to run the macro I got
Sub or Function not Defined.

Got error when tried macro
0
 
LVL 50

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 41881260
then try
Sub macro()

For Each shp In ActiveDocument.InlineShapes
    If shp.Type = wdInlineShapePicture Then
        Set rng = shp.Range
        rng.Collapse Direction:=wdCollapseEnd
        rng.InsertParagraph
        rng.InsertParagraph
        Set rng = ActiveDocument.Range(rng.Start + 1, rng.Start + 1)
        rng.Tables.Add Range:=rng, NumRows:=3, NumColumns:=4
        
    End If
Next
End Sub

Open in new window

0
 
LVL 1

Author Closing Comment

by:Alex972
ID: 41881281
Great! Thanks
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
Use Windows Task Scheduler to print a Word document weekly so your printer ink won't dry out.
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question