Solved

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

Posted on 2016-11-08
4
37 Views
Last Modified: 2016-11-09
0
Comment
Question by:Alex972
  • 2
  • 2
4 Comments
 
LVL 49

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 49

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

It is often necessary in this forum and others to illustrate Word fields as text with the field delimiters replaced with the curly brackets that the delimiters resemble when field codes are being displayed on the document. This means that the text c…
Introduction This tutorial provides instructions on how to properly format your Word document using the inbuilt tools provided. The benefits of using these tools means your documents are more accessible and easily portable to other applications an…
This video shows and describes the main difference between both orientations in Microsoft Word. Viewers will understand when to use each orientation and how to get the most out of them.
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.

815 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now