Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 01-06-2025, 08:26 AM
Italophile Italophile is offline VBA to Copy Text Between Heading Styles to New File Windows 11 VBA to Copy Text Between Heading Styles to New File Office 2021
Expert
 
Join Date: Mar 2022
Posts: 542
Italophile is just really niceItalophile is just really niceItalophile is just really niceItalophile is just really nice
Default

Quote:
Originally Posted by stusic View Post
One question I ran into, but didn't want to resurrect a dead thread: What if I don't have any bookmarks in my doc? I get an error when I get to this:

Code:
Set Rng = Rng.GoTo(What:=wdGoToBookmark, Name:="\HeadingLeve3")
As a guess, I tried this (but didn't work either, surprised /s)
Code:
Set Rng = Rng.GoTo(What:=wdGoHeading, Name:="\HeadingLeve3")
Your code is incorrect. The code linked to by macropod is:

Code:
Set Rng = Rng.GoTo(What:=wdGoToBookmark, Name:="\HeadingLevel")
You can learn more about predefined bookmarks in Word at Predefined Bookmarks | Microsoft Learn
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Stop styles from being copy pasted along with text Word_fail Word 4 07-10-2017 05:50 AM
Style for Text Changes from Normal to Heading 1 when Copy-Pasted Basia Word 8 08-15-2015 02:32 PM
VBA to Copy Text Between Heading Styles to New File Heading styles with text formatting othromas Word 9 11-13-2013 03:10 PM
VBA to Copy Text Between Heading Styles to New File Styles: Heading 4 stuck at same heading number Hallet Word 1 05-31-2012 02:37 PM
Copy + Paste from Word to Word WITHOUT heading styles altjx Word 4 04-18-2012 12:36 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:25 AM.


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