Results 1 to 5 of 5

Thread: Ms-word 2000 Vba Question

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2003
    Posts
    23

    Ms-word 2000 Vba Question

    Does anybody know how to disable word from issuing warnings such as levels of undo due to memory etc.

    Ideally its like in Access where u can say

    docmd.setwarnings = false

    I need to know the equivalent command for word VBA.

    I have a VB program that generates catalogues from an access database. It takes 3 days on a powerfull PC to create 13 documents. It means clicking yes to a word prompt every 3 hours.

  2. #2
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Word.Application.DisplayAlerts = wdAlertsNone
    Will do the trick.

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  3. #3
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Ms-word 2000 Vba Question

    Originally posted by scobiej
    It takes 3 days on a powerfull PC to create 13 documents. It means clicking yes to a word prompt every 3 hours.
    from your main question I would guess that you dont know about "ScreenUpdating" either... you can turn off the display updates for Office applications, which speeds them up significantly when used from an outside application (although it does mean that you cant see what is happening).

    you use it like this:
    VB Code:
    1. Word.Application.Visible = False
    2. Word.Application.ScreenUpdating = False
    3. Word.Application.DisplayAlerts = wdAlertsNone
    4.  
    5. < your code here >
    6.  
    7. Word.Application.DisplayAlerts = wdAlertsAll  '(I'm not sure about "wdAlertsAll", it might be "True")
    8. Word.Application.ScreenUpdating = False
    9. Word.Application.Visible = False

    the second half of this code should also be run in any error-handler that you have

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Nov 2003
    Posts
    23
    thanks SI, however, when i use that code word appears (GHOSTLIKE, as if display driver is messin the screen up).

    However, the YES / NO confirm about levels of undo and continuing still appear.

    It does appear to run faster though - which is great.

    any ideas as to how this can happen when the values have been set?

    many thanks

  5. #5
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974
    ok, try replacing "wdAlertsNone" with "False", and "wdAlertsAll" with "True". Ideally you should disable undo's too (or set a low limit to the number allowed), but I dont know how to do that.

    no idea about the display issue i'm afraid!

Posting Permissions

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



Click Here to Expand Forum to Full Width