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

    utility to print all code

    We are looking at upgrading to Office2007.

    In the current version of office, there is a great deal of repetive code.

    The goal is to to remove all repetitive code and place in one module.

    As we have many Word templates and others, I dont want to manually go into each individual template and print out each module.

    I was wondering if there is a utility that prints out all the code for each template.

    TIA

    diana

  2. #2
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: utility to print all code

    PrettyCode.Print for VB6/VBA says it can print out

    Visual Basic Project Groups (VBG)
    MS Office VBA projects (Office 2000+)
    Just any set of VB files
    Or you can just paste your code from Clipboard

    I don't know if this extends to "just any set of VBA projects". Maybe someone who uses it could chime in.

    VB/VBA Code Printer is another one I found, but have no familiarity with it.

    Alan

  3. #3
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: utility to print all code

    MZ-Tools is a useful add-in that might help with organising your code...

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

    Re: utility to print all code

    Thanks Alan , Leif

    I'll take a look

    diana

  5. #5
    5 Star Lounger
    Join Date
    Dec 2000
    Location
    Reading/Swindon, Berkshire, United Kingdom
    Posts
    664
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: utility to print all code

    I've used Prettycode in a previous life (but only in excel) and it could do all modules in a workbook but I'm fairly sure it couldn't do all modules in all workbooks open - and I'm certain you had to have the file open (but apart from that, it's well worth the money!)

  6. #6
    5 Star Lounger
    Join Date
    Dec 2000
    Location
    Reading/Swindon, Berkshire, United Kingdom
    Posts
    664
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: utility to print all code

    Another option might be to ask <!profile=chrisgreaves>chrisgreaves<!/profile> if he has a tool that can do this or look on his website - I know he was working on something along these lines a long time ago...

  7. #7
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: utility to print all code

    <P ID="edit" class=small>(Edited by chrisgreaves on 20-Dec-07 09:50. typo)</P>>We are looking at upgrading to Office2007.
    http://microsoftoffice2007.blogspot.com/
    and
    http://2007office.blogspot.com/

    >I was wondering if there is a utility that prints out all the code for each template.
    Better yet, there is an Engine that lets you create as many VBA applications as you want, by analysing template projects and building a structured view of them in a string array.
    I wrote the Engine, then used it to develop several analytic machines.
    Brooke was a bigger impetus than he knew back in 2000 (Remember telling me about CLS files!??) when I was developing my original Harvester - grab every scrap of VBA code from projects AND the text daily digests from Woody's lounge, and store them in a searchable library.

    Now it is embedded in a multi-purpose project management tool. of which Harvest is but one application (sorry Brooke!)
    I use it mainly for Strip: Remove deadwood unreferenced identifiers (data and procedures) from your project.
    You could probably use it as List: Document your program code, producing listings in documents.

    Or you could spend a small amount of time enveloping the analytic engine in a wrapper to build your own application.

    Your biggest task would be to define your term "repetitive code". Automatic analysis of the true function of a piece of code is difficult. Can be done, but best treated as a means of identifying likely-duplicates that need examination by humans. You could Strip comments and white space by using Rob Bovey's code, and then compare modules within my array.
    You could use the array as-is and compare parameter types and result types ( "... As String ..." ) to obtain a first match; function names and parameter names may differ too much to be of use.
    Of course, a direct match within the array is a sure bet, but may not be likely, unless your projects were cloned heavily.
    My Strip runs only within a project. I see no reason why it could not be extended across a set of projects.

    I have uploaded a ZIP file of documentation to http://www.chrisgreaves.com/Downloads/20071220.zip
    Please skim through the UserGuide to get a first impression.
    The WhatFAQ shows me that I've done no work on it for 18 months.
    LibraryFormat is the format of the original string for my Harvester of 2000. (A LAN is a collection of computers; a computer is a collection of drives; drives of folders, folders of files, files of modules, modules of procedures, procedures of lines. It follows that a company's entire collection of VBA code can be stored in a single string, and quickly searched using the Instr function). The format is still valid, and could be used to search your projects after a preliminary analysis. The three search functions of the GUI were powerful and, in some cases, extremely fast!

    Locating duplicate code across a LAN might well be the answer to my perennial question "What shall I do over the Christmas Break" (grin!)

    Brooke: Thanks again for your help over all these years, and for this morning's nudge. I'm awake now .....

  8. #8
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: utility to print all code

    >he has a tool that can do this or look on his website

    http://www.chrisgreaves.com/Downloads/ then look for Proje082; but if one is serious, contact me directly. I have a later version of the utility library, etc.

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

    Re: utility to print all code

    thank you

Posting Permissions

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