Solved

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

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

Expert Comment

by:Rgonzo1971
Comment Utility
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
 

Author Comment

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

Got error when tried macro
0
 
LVL 48

Accepted Solution

by:
Rgonzo1971 earned 500 total points
Comment Utility
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
 

Author Closing Comment

by:Alex972
Comment Utility
Great! Thanks
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Shortcuts in Word Just the other day I had a training for Microsoft and they wanted me to show how well the new Windows and Office behaved on a touch device, which by the way is great, but it was only then that I realized that using keyboard shortc…
This article describes how to use the Send to Mail Recipient command. The instructions apply generally to Office 2007 and later versions, but Microsoft® Word 2013 was used for the specific steps and figures.  What is Send to Mail Recipient? Send…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …

771 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

16 Experts available now in Live!

Get 1:1 Help Now