I think you're inconsistent with your file handles: sometimes you use a variable iFile and sometimes you use the constant 1
1. You need/should use FreeFile() to make sure that the file handle (e.g. 1) is not in use
2. I've always preferred to put the On Error as close to the statement(s) that I think are likely to cause an expected possible error
Without having the preceding code, including UnzipFold (which I'm guessing is a function) these are only somethings to explore
Option Explicit
Sub test()
Dim StrFilename2 As String, StrFilename3 As String, UnpackFold As String
Dim iFile As Long
Dim strTextLine As String
If 1 = 2 Then
MsgBox "Nope"
Else
' UnpackFold = UnzipFold(StrFilename)
UnpackFold = "Something"
StrFilename2 = UnpackFold & "file.docx"
On Error GoTo line1
iFile = FreeFile
Open StrFilename2 For Input As #iFile
Do Until EOF(iFile)
Input #iFile, strTextLine
Debug.Print "strTextLine : " & " " & strTextLine
Loop
Close #iFile
line1:
StrFilename3 = UnpackFold & "file2.docm"
iFile = FreeFile
On Error GoTo line2
Open StrFilename3 For Input As #iFile
Do Until EOF(iFile)
Input #iFile, strTextLine
Debug.Print "strTextLine : " & " " & strTextLine
Loop
Close #iFile
line2:
MsgBox "Do not recognize extension"
End If
End Sub