Public Function UnMonthDayCount(CurUnYear As Integer, CurUnMonth As Integer) As Integer
Dim UnMonthday
    If (CurUnYear \ 4 = CurUnYear / 4 And CurUnYear \ 100 <> CurUnYear / 100) Or CurUnYear \ 400 = CurUnYear / 400 Then      ' 月份天数
        UnMonthday = Array(0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
    Else
        UnMonthday = Array(0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
    End If
    UnMonthDayCount = UnMonthday(CurUnMonth)End Function以上即是你要的求X年X月的天数的函数,谢谢使用!

解决方案 »

  1.   

    对于第一个问题,我有更好的办法:(假定你的年、月是2001-05的形式)
    private function GetMonthDayCount(Month as string) as integer
        GetMonthDayCount=cint(right(format(cdate(format(cdate(Month & "-01")+32,"yyyy-MM") & "-01")-1,"yyyy-MM-dd"),2))
    end function
    随手写的,没有测试过,不过原理就很明显了。至于第二个问题,不知道你是怎么打印的?
    我也用连续纸打过很多东西,但是从来没有不用分页的,
    连续纸一样也有高度啊。
    把你的打印代码贴出来吧?