Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Newsgroup Archive
Word Newsgroups
Word VBA
File Size
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Kerry, post: 5814704"] 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") [/QUOTE]
Verification
Post reply
Forums
Archive
Newsgroup Archive
Word Newsgroups
Word VBA
File Size
Top