View Single Post
Old 07-04-05, 05:04 AM   #10 (permalink)
rusty1000
Aximsite Prospect
 
Join Date: Jul 2005
Posts: 3
iTrader Rating: (0)
Thanks: 0
Thanked 0 Times in 0 Posts
View MyPDA
Help
Originally Posted by BonBon
Thanks Talyn, I've been looking for this everywhere.

In case you're interested, I added a subroutine to handle Chapter Titles.
Just apply style 'Heading 1', 'Heading 2', 'Heading 3' for corresponding chapter title level 1, 2, and 3. Then this macro will put chapter title enclosure on them.
The good thing about having chapter titles is we'll also have a nice table of contents.

Code:
Private Sub doHeading()
    Dim i As Integer
    '''Heading 1 -> /X0 ... /X0
    '''Heading 2 -> /X1 ... /X1
    '''Heading 3 -> /X2 ... /X2
    For i = 0 To 2
        Selection.HomeKey unit:=wdStory
        With Selection.Find
            .Format = True
            .ClearFormatting
            .Style = "Heading " & Trim(Str(i + 1))
            .Text = ""
            .Wrap = wdFindContinue
            Do While .Execute
                Selection.Text = "\X" & Trim(Str(i)) & Selection.Text & "\X" & Trim(Str(i))
                Selection.MoveRight unit:=wdCharacter, Count:=1
            Loop
        End With
    Next i
End Sub
Then, just call this routine from the main sub Public Sub Word2PML() before the end of the sub.

Code:
    Application.Run macroname:="doHeading"
cheers,

BonBon


Hi Can you pleaee tell me how to incorporate your code into the macro. I am not a programmer and find all of this very technical.

I would be grateful if you could give me step by ste for this cheers
rusty1000 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote