Results 1 to 5 of 5
  1. #1
    PeterF
    Guest

    Compile TemplateProject (Word 2000)

    In Learning Word Programming (O'Reilly), Steven Roman writes:

    "Before a program can be executed, it must be compiled...The compilation process occurs automatically when we request that a program be executed. We can also specifically request compilation by choosing the Compile [Template]Project item under the Debug menu [in the Word VBA IDE]."

    If I have a template with say 20 macros, should I compile it as described above?

    What are the benefits of doing so?

    Are there any costs?

    If compilation occurs automatically, why is there an option to do it manually?

    Any enlightenment on this would be appreciated

    PeterF

  2. #2
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Compile TemplateProject (Word 2000)

    The point with compilation is that it spots some of the worst problems in your code. Compilation doesn't happen automatically when you create the code, but does when you try to run it.

    Therefore, if you don't compile manually when designing your template, you might find when you run it (or worse still, when your clients/users run it) that it crashes. If you compile it yourself first, you make sure it's OK and it will tell you if/where there are any problems.

    It's basically a case of writing instructions and then working through them to check you've got everything right before releasing them ...
    Beryl M


  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Compile TemplateProject (Word 2000)

    Sadly, I must add, you also should test it under various conditions, because the compiler will approve the syntax even if the logic is wrong or an assignment statement is invalid. Still, the compilation process catches the "Doh!" items, particularly if you use Option Explicit at the top of the module to catch typos in variable names.

  4. #4
    PeterF
    Guest

    Re: Compile TemplateProject (Word 2000)

    Thanks BerylM and Jefferson

    Now I get it.

    I asked are there any costs? There is one I discovered - after compilation, my template grew in size from 235 to over 280 kb.

    Jefferson I am puzzled that your post did not reach me as email, whereas Beryl's and previous ones from you did.

    Thank you both

    PeterF

  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: Compile TemplateProject (Word 2000)

    Peter,

    Jefferson's reply was not sent directly to you, that's why you didn't get notification.

    If you want to see if any thread you are interested in gets modified, without having to search each forum, click on the "Add 5to watched thread list" at the top of the page, just next to the printer icon. Then click on "Controls" on the top grey bar to view you list of saved threads.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

Posting Permissions

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