Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-25-2023, 07:54 AM
Italophile Italophile is offline Paste in picture, wrap with line, format paragraph before and picture...close to working Windows 11 Paste in picture, wrap with line, format paragraph before and picture...close to working Office 2021
Expert
 
Join Date: Mar 2022
Posts: 563
Italophile is just really niceItalophile is just really niceItalophile is just really niceItalophile is just really nice
Default

When you record a macro you will get a lot of code that you don't need. That code can safely be deleted.



As you didn't move the selection after adding the new paragraph your subsequent code was executed on the original selection.

When you post code in a question here you need to use the code format button (#)

The only code you actually need is below.

Code:
Sub PastePictureAndCenter()
    Dim target As Range
    Set target = Selection.Range
    With target
        .ParagraphFormat.KeepWithNext = True
        .InsertParagraphAfter
        .Move wdParagraph
        .Style = ActiveDocument.Styles("OAR Para No Ind for Picture")
        .Paste
        .InlineShapes(1).Line.Visible = msoTrue
    End With
End Sub
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Paste in picture, wrap with line, format paragraph before and picture...close to working Wrap Text Inside Picture marconexcel Drawing and Graphics 2 02-02-2018 05:01 PM
Paste in picture, wrap with line, format paragraph before and picture...close to working Wrap TABLES around picture? ShankedS Word Tables 2 11-16-2015 04:27 PM
Paste in picture, wrap with line, format paragraph before and picture...close to working Format Picture toolbar button not working in Word 2007 WaltR Word 2 08-19-2015 05:19 PM
How do you paste a graph from Excel into Word as picture without line appearing? swygant Word 10 07-01-2014 03:23 PM
Paste in picture, wrap with line, format paragraph before and picture...close to working "format picture" - arrows show as no line atop picture marbeth Word 3 07-08-2011 02:16 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:29 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