Harvey
Thu Feb 15 18:31:02 CST 2007
I have another sub which calles the sub I sent it previously and it has error
handler so I don't really know which code generates this error.
Im pasting the other sub also which loads the form.
Private Sub UserForm_Initialize()
'cancel is true unless user clicks 'OK' and no error
g_blnChapterCancel = True
Dim lblSource, lblDestination As String
Dim iChapType As Integer, isec As Integer
On Error GoTo errorhandler
'1 - Chapter New 11 - Sub New
'2 - Chapter Insert 12 - Sub Insert
'3 - Chapter Delete 13 - Sub Delete
'4 - Chapter Copy 14 - Sub Copy
'5 - Chapter Change Title 15 - Sub Change Title
'6 - Chapter Move 16 - Sub Move
'load appropriate captions (see above for g_iType list)
iChapType = 1 'this is 1 until specified otherwise - for chapter use
'2 - adds 'DESIGNATE AS LAST CHAPTER' to list
'3 - for Sub-Chapter use
'4 - adds '****subchapter line
Select Case g_iType
Case 1
lblSource = "Location of New Chapter? Insert BEFORE..."
iChapType = 2
Case 2
lblSource = "Location of Chapter? Insert BEFORE..."
iChapType = 2
Case 3
lblSource = "DELETE chapter..."
Case 4
lblSource = "COPY chapter..."
Case 5
lblSource = "Select the Chapter Title to be changed..."
Case 6
lblSource = "MOVE Chapter..."
lblDestination = "BEFORE..."
Me.Height = 126
Me.cmdOk.Top = 82
Me.cmdCancel.Top = 82
Me.lblDestination.Visible = True
Me.cmbDestination.Visible = True
Case 13
lblSource = "Delete Sub-Chapter..."
iChapType = 3
Case 14
lblSource = "Copy Sub-Chapter..."
iChapType = 3
Case 15
lblSource = "Select the Sub-Chapter Title to be changed..."
iChapType = 3
End Select
Me.lblSource = lblSource
Me.lblDestination = lblDestination
'get and load chapter list
GetChapList iChapType
For isec = 1 To UBound(ChapListArr)
Me.cmbSource.AddItem ChapListArr(isec).sTitle
Next isec
'get second list if MOVE
If (g_iType = 6) Then
iChapType = 2
GetChapList iChapType
For isec = 1 To UBound(ChapListArr)
Me.cmbDestination.AddItem ChapListArr(isec).sTitle
Next isec
End If
GoTo finish
errorhandler:
Select Case Err.Number
Case 0
' Do nothing
Case 91
MsgBox g_constrERROR & Err.Number & vbCr & vbCr & "Error loading
list of chapters or sub-chapters." & vbCr & _
g_constrROUTINE & "frmChapterList", _
vbInformation + vbExclamation, _
g_constrTITLE
Case Else
MsgBox g_constrERROR & Err.Number & vbCr & vbCr &
Err.Description & vbCr & _
g_constrROUTINE & "frmChapterList", _
vbInformation + vbExclamation, _
g_constrTITLE
End Select
'reset values
g_iType = 0
ReDim ChapListArr(1)
Unload Me
finish:
Me.Show
End Sub
"Jean-Guy Marcil" wrote:
> Harvey was telling us:
> Harvey nous racontait que :
>
> > yes I got the same error #91 on my computer also but as i said when i
> > turn on the paragraph marks i don't get the error and this code works
> > fine. I moved the entire document to a new documnet (using macros)
> > and now I don't get this error even with paragraph marks off. So Im
> > wondering what could be the connection between formatting marks
> > showing and getting this error message?!
>
> When you debugged the error, which code line is highlighted by the debugger?
>
> --
>
> Salut!
> _______________________________________
> Jean-Guy Marcil - Word MVP
> jmarcilREMOVE@CAPSsympatico.caTHISTOO
> Word MVP site:
http://www.word.mvps.org
>
>
>