Userform not getting events in batch job

G

gtoumi

Hi all.
I have some vba code in word 2000 that applies a macro to thousands of
word documents.
I'm trying to get some feedback on what's going on, so I created a
UserForm with some textbox where the macros can output information.

My problem is that the userform doesn't have the chance to get events,
and I can't do anything with it (move it, scroll the textbox) as long
as the bach job is running.

I'm quite the newbie in VBA programming (and win32 programming in
general),
so i guess i'm missing something obvious.

my output sub does something like :

Sub wln(sMsg As String)
Console.TextBox1.Text = Console.TextBox1.Text & sMsg & vbcrlf
Console.Repaint
End Sub

the userform is non modal, has a plain button and a scrollable textbox,
and that's about all...

Any pointers ?

Thanks

Ghoz
 
D

Doug Robbins - Word MVP

Why not just display a message box? Or, write the information to the status
bar?

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
J

Jezebel

You'll need to use DoEvents to let the form update. But with thousands of
documents, this is very heavy overhead you're adding. Pay heed to Doug's
suggestions.
 
G

gtoumi

Hi,
Why not just display a message box? Or, write the information to the status
bar?

message box : the job is running in background, so i can't have a
message box that waits for the user to ack it unless i don't understand
what you mean, this is not practicable.

as for the status bar, i use it, but
- word opening and closing the documents changes the status bar, so my
messages only flash briefly between opening and document saves
- i can't have a detailed "log" of what's going on
- i can't cancel the job

anyway, right now, i have to kill word the hard way to stop the job :-/

Ghoz
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top