Display scrolling file details

Robie
5StarLounger
Posts: 656
Joined: 18 Feb 2010, 14:26

Display scrolling file details

Post by Robie »

Hi

I am copying some information and files from one area to another using Word VBA (VBA does other things as well). There could be 100s of files being copied.
So, is it possible to display a list of file names being copied (one after the other) as they are processed? This would be similar to an installer copying files to your computer and shows the list of files as they are being copied.

This is not very important if there is no simple solution.

Thanks.
Robie

User avatar
macropod
4StarLounger
Posts: 508
Joined: 17 Dec 2010, 03:14

Re: Display scrolling file details

Post by macropod »

You could display the current file's name on Word's status bar. See, for example: http://www.msofficeforums.com/word-vba/ ... #post64563" onclick="window.open(this.href);return false;
Paul Edstein
[Fmr MS MVP - Word]

User avatar
HansV
Administrator
Posts: 78494
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Display scrolling file details

Post by HansV »

In Word 2010 and before, you can display the name of the file being processed in the status bar:

Application.StatusBar = strFileName

where strFileName is a string variable containing the filename. This doesn't work in Word 2013 (and presumably, later versions) anymore.

Another option would be to display the filename in a modeless userform, for example in the caption of a label. To update the userform, use its Repaint method:

Code: Select all

    With UserForm1
        .Label1.Caption = strFileName
        .Repaint
    End With
Best wishes,
Hans

Robie
5StarLounger
Posts: 656
Joined: 18 Feb 2010, 14:26

Re: Display scrolling file details

Post by Robie »

Wow. I didn't know about the status bar update. I think that is a simple solution that would work for me.

Thank you so much Paul and Hans. It turned out to be simpler than I thought. :)