Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 07-12-2022, 03:52 PM
macropod's Avatar
macropod macropod is online now using MS Word Styles with objects Windows 10 using MS Word Styles with objects Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

If you insert such an object in the document, then Cut it (and, presumably, the paragraph break following it) from there to place it in the clipboard, you could use Find/Replace, where:
Find = empty, but Heading 1 Style specified
Replace = ^&^c

A macro to do the same thing:
Code:
Sub Demo()
Application.ScreenUpdating = False
With ActiveDocument.Range
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = ""
    .Replacement.Text = "^&^c"
    .Format = True
    .Forward = True
    .Style = wdStyleHeading1
    .Wrap = wdFindContinue
    .Execute Replace:=wdReplaceAll
  End With
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
using MS Word Styles with objects Replace Embedded Objects with Linked Objects hicksi Word 3 09-29-2021 07:17 PM
Locking styles in Word using VBA to restrict new styles cadillac1206 Word VBA 1 04-21-2020 01:08 AM
Accessing word objects Erdanova Excel 2 12-12-2019 06:11 AM
using MS Word Styles with objects Macros to move objects prevents moving same objects with arrow keys BruceM Word VBA 1 03-10-2015 08:20 AM
using MS Word Styles with objects Convert equation objects to inline objects sumjoh Word VBA 1 01-29-2013 08:38 PM

Other Forums: Access Forums

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