Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-03-2018, 08:23 AM
Fouko Fouko is offline Show chapter by checkbox Windows 10 Show chapter by checkbox Office 2016
Novice
Show chapter by checkbox
 
Join Date: Aug 2018
Posts: 8
Fouko is on a distinguished road
Default

I let this message, but see the update in the next one.

Great and quick answer, that's work well !

I tried by myself to add introduction text at the top of document by adding your code with some modification, but nothing appears even there is no error. The introduction part have the bookmark name bmStartChapter.



I put this code just after the Dim list section

Code:
'Add introduction text at the beginning
        Set oSource = ThisDocument
        Set oDoc = Documents.Add(oSource.FullName)
        Set oRng = oDoc.Range
        oRng.Collapse 0
        oRng.FormattedText = oSource.Bookmarks("bmStartChapter").Range.FormattedText
Reply With Quote
  #2  
Old 08-03-2018, 09:44 AM
Fouko Fouko is offline Show chapter by checkbox Windows 10 Show chapter by checkbox Office 2016
Novice
Show chapter by checkbox
 
Join Date: Aug 2018
Posts: 8
Fouko is on a distinguished road
Default

I found my error

In fact I need to put the code after the line :
Code:
        oDoc.Range.Text = ""
And that works !!!

Any ideas how to put this condition that chapter 1 and/or 2 need to be checked to validate the document ? Without this condition, the macro send a message.

Thanks, I learn quickly with you.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bookmark will not show/hide based on CC Checkbox lord_kaiser Word VBA 1 04-17-2018 01:19 AM
Show chapter by checkbox How to use checkbox to show/hide bookmarked text? namrehx Word VBA 16 12-14-2017 01:45 PM
How to use checkbox to show and hide bookmarked text? namrehx Word VBA 1 12-12-2017 02:17 PM
Show chapter by checkbox Show Userform when Content Control CheckBox ticked derajlance Word VBA 1 05-13-2016 01:55 PM
Show chapter by checkbox Show/Hide Text based on Checkbox Selection tammytran105 Word VBA 7 10-02-2014 04:30 PM

Other Forums: Access Forums

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