• utility to print all code

    Author
    Topic
    #446988

    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

    Viewing 3 reply threads
    Author
    Replies
    • #1088316

      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

      • #1089061

        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!)

    • #1088559

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

    • #1089152

      Another option might be to ask chrisgreaves 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…

    • #1089194

      (Edited by chrisgreaves on 20-Dec-07 09:50. typo)

      >We are looking at upgrading to Office2007.
      http://microsoftoffice2007.blogspot.com/%5B/url%5D
      and
      http://2007office.blogspot.com/%5B/url%5D

      >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%5B/url%5D
      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 …..

    Viewing 3 reply threads
    Reply To: utility to print all code

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: