dim  ss as string*30所有的ss都为30个字母或15个文字 保持

解决方案 »

  1.   

    比如:需要10个字符长度,
    sub SetToLength(s as string,n as long)
       if len(s)>n then
          s=left(s,n)
       end if
       if len(s)<n then
          s=s + space(n-len(s))
       end if
    end sub
      

  2.   

    试试format函数,应该可以吧!
    语法参考MSDN
      

  3.   

    with object1 '例如form1, printer 等
      .fontsize = .fontsize * width1 / .textwidth(str1)
      debug.print .textwidth(str1)  '约等于width1
    end with