View Single Post
 
Old 04-08-2014, 05:12 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,366
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

I tried to run your code, but it fell over as soon as I clicked the browse button, at:
Me.lblPresentationDirectory = "*PROJECT*" & Mid(Me.lblPresentationDirectory.Caption, l + 1)
with a compile error "can't find project or library".

Leaving that aside, I also had a look at your document. To be sure, the 'heading row repeat' option is checked, but the row doesn't repeat. But! Unchecking, then re-checking the option fixes the problem.

I also note that your code has a number of places where it's trying to manipulate the heading format:
Sub ProcessScriptBlock -
ScriptTable.Rows(RowCount).HeadingFormat = False

Function CreateScriptForPresentation -
If GenScript.CreateRecordingScript Then
RecordingScriptTable.Rows(1).HeadingFormat = True
RecordingScript.Close SaveChanges:=wdSaveChanges
End If
If GenScript.CreateShootingScript Then
ShootingScriptTable.Rows(1).HeadingFormat = True
ShootingScript.Close SaveChanges:=wdSaveChanges
End If

Sub InitiateScript -
ScriptTable.Rows(1).HeadingFormat = True

Might I suggest you leave all HeadingFormat manipulations till the very end, then use a simple loop like the following before saving:
Code:
Dim Tbl As Word.Table
For Each Tbl In WordApp.ActiveDocument.Tables
  With Tbl
    .Rows.HeadingFormat = False
    .Rows(1).HeadingFormat = True
  End With
Next
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote