K
Kerry
Hi
I am using Word XP
I have a procedure which saves the current file and shows
me the file size (to check against e-mail attachment size
policy). The problem is that the size is only shown in K,
I would really like it to be MB or a decimal of MB. I
have tried calculating but seems to give rather strange
answers.
Can this be done?? I have searched newsgroups, support
sites and books but cannot find a thing about file size in
MB.
Thanks very much.
Kerry.
--------------------------
Original Code:-
Dim CurrName As String
Dim lflen As Long
ActiveDocument.Save
CurrName = ActiveDocument.FullName
lflen = FileLen(CurrName)
fn = MsgBox(lflen & " k",vbOKOnly,"Current File Size")
Calculation Test Code:
Dim CurrName As String
Dim lflen As Single
ActiveDocument.Save
CurrName = ActiveDocument.FullName
lflen = FileLen(CurrName)
lflen = lflen / 1024
fn = MsgBox(lflen & " mb", vbOKOnly, "Current File
size")
I am using Word XP
I have a procedure which saves the current file and shows
me the file size (to check against e-mail attachment size
policy). The problem is that the size is only shown in K,
I would really like it to be MB or a decimal of MB. I
have tried calculating but seems to give rather strange
answers.
Can this be done?? I have searched newsgroups, support
sites and books but cannot find a thing about file size in
MB.
Thanks very much.
Kerry.
--------------------------
Original Code:-
Dim CurrName As String
Dim lflen As Long
ActiveDocument.Save
CurrName = ActiveDocument.FullName
lflen = FileLen(CurrName)
fn = MsgBox(lflen & " k",vbOKOnly,"Current File Size")
Calculation Test Code:
Dim CurrName As String
Dim lflen As Single
ActiveDocument.Save
CurrName = ActiveDocument.FullName
lflen = FileLen(CurrName)
lflen = lflen / 1024
fn = MsgBox(lflen & " mb", vbOKOnly, "Current File
size")