[www.theword.net]

Twitter live feed  
View unanswered posts | View active topics It is currently Sat Oct 23, 2021 10:16 am



Reply to topic  [ 9 posts ] 
 creating topic trees 
Author Message

Joined: Mon Jan 07, 2019 5:33 pm
Posts: 6
Post creating topic trees
I have a book of my own that I want to put into theWord and I have searched and cannot find how to format my RTX file to cause it to put the CHAPTERS in the option tree or subject tree.
How do I need to format the chapter headings to get them in the tree when I run the file through the Importer Utility?

Thanks
Jim


Sun Apr 14, 2019 9:53 pm
Profile
User avatar

Joined: Wed Jun 04, 2008 7:34 pm
Posts: 4236
Post Re: creating topic trees
can you post the file, or a link to it?

_________________
Jon
the
Word 5 Bible Software
OS for testing; Windows 10
Beta Download ------Beta Setup Guide------On-line Manual------Tech doc's and Utilities------Copyright Factsheet


Sun Apr 14, 2019 9:57 pm
Profile

Joined: Mon Jan 07, 2019 5:33 pm
Posts: 6
Post Re: creating topic trees
Ok would not let me attach an rtf but here is a link. It is 4 Edras that I modified.

http://realtruth.net/documents/2%20Ezra.rtf

I saw where there was suppose to be a good beginners formatting discussion but cannot find it. Also in this thread viewtopic.php?f=4&t=6817 it says
Quote:
Chapter divisions. Ideally an ordinary book module should be divided by chapter, so that the title of each chapter is visible in the "topic tree."

OK I understand the logic of what to show, but I do not know HOW to make it show.

One other question is there anyway to get a verse reference Isa 58:1; Ex 14:29 to popup the verse with a mouse-over in a book module?
Thanks
Jim


Mon Apr 15, 2019 3:33 am
Profile
User avatar

Joined: Wed Jun 04, 2008 7:34 pm
Posts: 4236
Post Re: creating topic trees
For the importer tool to make a book with such a structure, you have to have individual rtf documents where the filename becomes the topic in the tree when imported.

I have a Word macro that does this on Heading1 style as the filename split.

Would you know your way forward with it?

_________________
Jon
the
Word 5 Bible Software
OS for testing; Windows 10
Beta Download ------Beta Setup Guide------On-line Manual------Tech doc's and Utilities------Copyright Factsheet


Mon Apr 15, 2019 10:05 am
Profile

Joined: Mon Jan 07, 2019 5:33 pm
Posts: 6
Post Re: creating topic trees
Sure, I could make it work if you want to share the macro. You can just email it to me if you want or post it here.

I had thought about breaking it up into different files but was hoping there was a different way to it.

Anyway to manually add the bookmarks to the tree? I tried adding a topic but no way to link it to the bookmark.

Any thoughts on getting scripture to popup when you mouse-over a passage, anyway to make it reference, maybe a url?

Much appreciated and thanks again.

Jim


Attachments:
File comment: Boolmarks on a book module.
2019-04-15 08_29_34-Luke 1_5 - theWord.png
2019-04-15 08_29_34-Luke 1_5 - theWord.png [ 22.3 KiB | Viewed 1450 times ]
Mon Apr 15, 2019 2:22 pm
Profile
User avatar

Joined: Wed Jun 04, 2008 7:34 pm
Posts: 4236
Post Re: creating topic trees
To make the verse refs as popups there are several ways internally. Make the module user editable.(Ctrl+Shift+u is a quick toggle) you can press Ctrl d in the topic or right click menu, and select detect vrefs, or go to the properties page of the module ->settings and actions tab ->actions->detect all verse references.... Execute action
There will be some false detection with 2 Ezra... as Ezra will be picked up. You could try changing those to 2 Ezra_ so they are not detected, or just live with it.


Here is the macro.
I usually put the rtf original in its own folder so that it contains all the split files. Then remove the original and run the importer on the folder. The module should be made in that folder.
Also for your example you might need to sort the topics when building the module. There is an option to sort topics alphabetically with a regular expression. I used
Code:
^.+? (\d+)
as the regex and it seems to do the job.


See post below for better macro

_________________
Jon
the
Word 5 Bible Software
OS for testing; Windows 10
Beta Download ------Beta Setup Guide------On-line Manual------Tech doc's and Utilities------Copyright Factsheet


Mon Apr 15, 2019 2:44 pm
Profile

Joined: Mon Jan 07, 2019 5:33 pm
Posts: 6
Post Re: creating topic trees
Excellent!!! Perfect I can work with all of this. Just makes an easier study tool for me.

Thank-you very much!

Jim


Mon Apr 15, 2019 2:52 pm
Profile
User avatar

Joined: Wed Jun 04, 2008 7:34 pm
Posts: 4236
Post Re: creating topic trees
This is probably a better macro as Word will not flash so much and you get a Job done! message
Code:
Sub SplitDocOnHeading1ToRtfNoHeadingInOutput()
'Splits the document on Heading1 style, into new documents, Heading1 is NOT included in the data
'but becomes the file name. Useful if you are splitting the document to be a commentary and you want the files to put through
'the Importer tool to have the format 1.1.1.rtf
'With Word.Application 'To stop Word opening another visible window add these ##########
    '.Visible = False '##########

Application.ScreenUpdating = False
Dim Rng As Range, DocSrc As Document, DocTgt As Document
Dim i As Long, StrTxt As String: Const StrNoChr As String = """*/\:?|"
Set DocSrc = ActiveDocument
With DocSrc.Range
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Format = True
    .Forward = True
    .Text = ""
    .Style = wdStyleHeading1
    .Replacement.Text = ""
    .Wrap = wdFindStop
    .Execute
  End With
  Do While .Find.Found
    Set Rng = .Paragraphs(1).Range
    Set Rng = Rng.GoTo(What:=wdGoToBookmark, Name:="\HeadingLevel")
    'Set DocTgt = Documents.Add(DocSrc.AttachedTemplate.FullName)
    'Set DocTgt = Documents.Add(DocSrc.AttachedTemplate.FullName, , , False) 'this leaves Word visible but stops most flashing
    Set DocTgt = Documents.Add(Template:=DocSrc.AttachedTemplate.FullName, Visible:=False) 'Slight difference in coding same thing.
    With DocTgt
    Application.ScreenUpdating = False
      .Range.FormattedText = Rng.FormattedText
      StrTxt = Split(.Paragraphs.First.Range.Text, vbCr)(0)
      ' Strip out illegal characters
      For i = 1 To Len(StrNoChr)
        StrTxt = Replace(StrTxt, Mid(StrNoChr, i, 1), "_")
      Next
      .Paragraphs.First.Range.Delete 'comment out this line if you want to retain headings in the output file
      .SaveAs2 FileName:=DocSrc.Path & "\" & StrTxt & ".rtf", Fileformat:=wdFormatRTF, AddToRecentFiles:=False
      .Close False
    End With
    .Start = Rng.End
    .Find.Execute
  Loop
End With
Set Rng = Nothing: Set DocSrc = Nothing: Set DocTgt = Nothing
Application.ScreenUpdating = True
MsgBox "Job Complete", vbOKOnly, "Status of Macro"
        ' .Visible = True '##########
       ' End With '##########
End Sub

_________________
Jon
the
Word 5 Bible Software
OS for testing; Windows 10
Beta Download ------Beta Setup Guide------On-line Manual------Tech doc's and Utilities------Copyright Factsheet


Mon Apr 15, 2019 3:18 pm
Profile

Joined: Mon Jan 07, 2019 5:33 pm
Posts: 6
Post Re: creating topic trees
Had to remove the index and it worked perfectly. For some reason the index caused the macro to crash but once I removed it, it worked flawlessly!!

Thanks!!!!!

Jim


Mon Apr 15, 2019 3:58 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 9 posts ] 

Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.738s | 17 Queries | GZIP : Off ]