I posted this as a vague question some time back, and was asked for
more detail... so, I'll try and clarify:

I write training documentation, and in this documentation we
occasionally insert an 'instructor notes page'... which is basically a
page (always even-numbered) containing notes for the teacher regarding
the content on the next page. A document may have any number of these
notes pages, and we currently are using an autotext entry to insert the
page based on a heading style that breaks the page (so, no formal
page-break is used when inserting). However, this approach could be
changed.

After creating a document with n numbers of notes pages, I need to be
able to run a script or macro to programmatically loop through and
delete all of these notes pages. One of my co-workers recommended
attaching a bookmark to the notes page autotext, and then creating code
to loop through and delete the bookmarks (we don't use bookmarks
currently), resulting in a notes page free document. However, I found
out that I'd need a new bookmark name for each notes page I insert!
This becomes a problem for deletion because, even if I manually
bookmark every notes page, I don't have any code/script/macro that
would delete ALL sections defined by bookmarks within a document.

If there was a way to just say, "Delete all sections that are
bookmarked within this document." we may have a solution. Otherwise,
let's not think about bookmarks. Is there a way I could use
find/replace on the style used for the heading text on the notes page?
Or, perhaps use a specific font for notes and find/delete that font
style? Or could I somehow customize the page/section breaks for notes
pages? The possibilities are wide-open.

I look forward to your feedback, and feel free to ask questions if
anything needs clarification.

Re: Search & Delete Notes Pages by jstengren

jstengren
Thu Aug 03 11:29:24 CDT 2006

I had an idea... since each of these notes pages is started with a
*heading-notes style and ends with a page break, can't I somehow search
the document for the*heading-notes style, then define a section from
that style to the next page break, and then delete -- loop through the
entire document repeating that process?

jstengren wrote:
> I posted this as a vague question some time back, and was asked for
> more detail... so, I'll try and clarify:
>
> I write training documentation, and in this documentation we
> occasionally insert an 'instructor notes page'... which is basically a
> page (always even-numbered) containing notes for the teacher regarding
> the content on the next page. A document may have any number of these
> notes pages, and we currently are using an autotext entry to insert the
> page based on a heading style that breaks the page (so, no formal
> page-break is used when inserting). However, this approach could be
> changed.
>
> After creating a document with n numbers of notes pages, I need to be
> able to run a script or macro to programmatically loop through and
> delete all of these notes pages. One of my co-workers recommended
> attaching a bookmark to the notes page autotext, and then creating code
> to loop through and delete the bookmarks (we don't use bookmarks
> currently), resulting in a notes page free document. However, I found
> out that I'd need a new bookmark name for each notes page I insert!
> This becomes a problem for deletion because, even if I manually
> bookmark every notes page, I don't have any code/script/macro that
> would delete ALL sections defined by bookmarks within a document.
>
> If there was a way to just say, "Delete all sections that are
> bookmarked within this document." we may have a solution. Otherwise,
> let's not think about bookmarks. Is there a way I could use
> find/replace on the style used for the heading text on the notes page?
> Or, perhaps use a specific font for notes and find/delete that font
> style? Or could I somehow customize the page/section breaks for notes
> pages? The possibilities are wide-open.
>
> I look forward to your feedback, and feel free to ask questions if
> anything needs clarification.


Re: Search & Delete Notes Pages by Russ

Russ
Sat Aug 12 17:48:59 CDT 2006

Jstengren,
Reply in middle of text.

> I had an idea... since each of these notes pages is started with a
> *heading-notes style and ends with a page break, can't I somehow search
> the document for the*heading-notes style, then define a section from
> that style to the next page break, and then delete -- loop through the
> entire document repeating that process?
>
> jstengren wrote:
>> I posted this as a vague question some time back, and was asked for
>> more detail... so, I'll try and clarify:
>>
>> I write training documentation, and in this documentation we
>> occasionally insert an 'instructor notes page'... which is basically a
>> page (always even-numbered) containing notes for the teacher regarding
>> the content on the next page. A document may have any number of these
>> notes pages, and we currently are using an autotext entry to insert the
>> page based on a heading style that breaks the page (so, no formal
>> page-break is used when inserting). However, this approach could be
>> changed.
>>
>> After creating a document with n numbers of notes pages, I need to be
>> able to run a script or macro to programmatically loop through and
>> delete all of these notes pages. One of my co-workers recommended
>> attaching a bookmark to the notes page autotext, and then creating code
>> to loop through and delete the bookmarks (we don't use bookmarks
>> currently), resulting in a notes page free document. However, I found
>> out that I'd need a new bookmark name for each notes page I insert!
>> This becomes a problem for deletion because, even if I manually
>> bookmark every notes page, I don't have any code/script/macro that
>> would delete ALL sections defined by bookmarks within a document.
>>
>> If there was a way to just say, "Delete all sections that are
>> bookmarked within this document." we may have a solution.
Dim aBookMark As Word.Bookmark
For Each aBookMark In ActiveDocument.Bookmarks
aBookMark.Range.Expand Unit:=wdSection
aBookMark.Range.Delete
Next aBookMark
End Sub

This works, if your notes are delineated by section breaks before and after;
and each has a bookmark embedded within. Or leave out the expand line of
code, if each note is bookmarked as a whole and not 'sectioned' off.
>> Otherwise,
>> let's not think about bookmarks. Is there a way I could use
>> find/replace on the style used for the heading text on the notes page?
>> Or, perhaps use a specific font for notes and find/delete that font
>> style? Or could I somehow customize the page/section breaks for notes
>> pages? The possibilities are wide-open.
>>
>> I look forward to your feedback, and feel free to ask questions if
>> anything needs clarification.
>

Also, you could could format your notes' font as hidden and show or hide the
text or option to print hidden text or not.
--
Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID