'定长字符串
' 0 左  1中  2 右
Function LEN_STR(ByVal nStr as String  ,ByVal LENs as Long,ByVal  Al as Long =0 ) as String
  
  ' 0 左  1中  2 右
  Dim byu  as Long
  Dim L as Long, H as Long,I as Long
  byu = Len(nStr)
  If byu > LENs Then
      If LENs < 4 Then
          Function= String(LENs, ".")
      Else
          L=0
          If Asc(nStr,lens-3)>126 Then '表示最后有中文
              For i=1 To lens-3
                  If Asc(nStr,i)>126 Then l=l+1
              Next
          End If
          If l Mod 2 =1 Then
              Function= Mid(nStr, 1, LENs - 1) & toStr(".")
          Else
              Function= Mid(nStr, 1, LENs - 2) & toStr("..")
          End If
      End If
      Exit Function
  End If
  L=LENs-Len(nStr)
  If L>0 Then
      Select Case al
        Case 0
          Function= nStr & Space(L)
        Case 1
          H=L/2
          i=L-h
          Function= Space(H) & nStr & Space(I)
        Case 2
          Function=Space(L) & nStr
      End Select
  Else
      Function= nStr
  End If
End Function