Results 1 to 7 of 7
  1. #1
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VB6 - in toolbox - there is a timer control (VB6)

    Is there a reason you don't want to use the VBA OnTime method which should be able to do the same thing?
    Legare Coleman

  2. #2
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    VB6 - in toolbox - there is a timer control (VB6)

    Hi ya

    In VB6 - in the toolbox - there is a timer control- which I would like to implement & have in my VBA code.
    Can I bring the timer control into VBA?
    How do I bring it in?
    Do I need to add reference libraries?
    Do I need to load .dlls onto my c drive?

    thanks in advance - Diana.

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VB6 - in toolbox - there is a timer control (VB6)

    HI Leagre

    What I'm doing is sending the document to the printer
    with PrintOut Background:=True
    (meaning the code continues to run while word prints)
    & I need to determine if file has completed spooling/ printing before I can continue my code.

    when I use the OnTime method
    the result is
    for some reason the application doesnt freeze but is caught up in some loop & 'pauses' or freezes the printer spooling.
    So I tested on a large document eg 70 pages
    the code runs onTime
    sends document to print
    & stops spooling on page 2 & doesnt complete
    so I have to CTRL Break to stop the code
    as its in some loop.

    I've been frying about the timer code for a few weeks.
    I thought I'ld use the VB6 timer control
    & do like a time counter & see if that works.

    Another solution was
    set background to False
    eg PrintOut Background:=False
    this means it will the code will stop until printing is completed & then code resume when prining completed.

    With Background set to False - this displays a default
    word dialog box (see attachment of sample).
    I thought if I could capture this default word message box & before capturing hide the message box & display my own custom message box.

    - this will work but I dont know how to capture or hide the default word message box.
    any ideas?
    Diana
    Attached Files Attached Files

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: VB6 - in toolbox - there is a timer control (VB6)

    Timers don't do what you seem to think they do. Timers interrupt other code and override it, which is probably why you haven't had any success with the OnTime method. You're better off with the alternative method.
    Charlotte

  5. #5
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VB6 - in toolbox - there is a timer control (VB6)

    Diana,

    I couldn't find a way to reference the timer control from VBA.

    I don't know if this KB article on <A target="_blank" HREF=http://support.microsoft.com/support/kb/articles/Q118/4/68.asp>DoEvents</A> might help.

    Or would:
    Application.DisplayAlerts = wdAlertsNone

    Get rid of your message box?
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  6. #6
    New Lounger
    Join Date
    Sep 2003
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VB6 - in toolbox - there is a timer control (VB6)

    I don't know what you had in mind for checking the spooler status, but you might try putting it into a Do Until loop.
    For example:
    In your print procedure...

    Do Until SpoolerFinished = True
    DoEvents
    Loop

    Then a separate function...
    Function SpoolerFinished() As Boolean
    'Code to check spooler status...
    End Function

    Darryl

  7. #7
    2 Star Lounger
    Join Date
    Feb 2001
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VB6 - in toolbox - there is a timer control (VB6)

    I never could find a way to put a timer into Word. Instead I wrote a VB program that automates Word and sets the timer. After the timer runs out(The program set it for a minute), the program checks the number of documents in the print spool. If there are still some, the program set the timer again until the number of docs in the print spool is zero.

    This was for a program that converted piles of documents to PDF on a daily basis.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •