i = 1 To Len(Filter)
        ch = Mid$(Filter, i, 1)
        If ch = "|" Or ch = ":" Then
            s = s &amp; vbNullChar
        Else
            s = s &amp; ch
        End If
    Next
    ' Put double null at end
    s = s &amp; vbNullChar &amp; vbNullChar
    .lpstrFilter = s
    .nFilterIndex = FilterIndex

    ' Pad file and file title buffers to maximum path
    s = Filename &amp; String$(MAX_PATH - Len(Filename), 0)
    .lpstrFile = s
    .nMaxFile = MAX_PATH
    s = FileTitle &amp; String$(MAX_FI