For some time I have wanted to create a utility (CodePrint) that would print the code in a given module (or modules) in a useful format (with index, line numbers, etc). So as part of defining the requirements and user interface, I have a requirement to be able to open any Office document (SourceDoc), and offer the code modules that are in it,from which I can select one or many, for printing.
The selected modules are then copied to a separate Word document (TargetDoc) where the formatting is carried out. This leads to a potential problem if the selected SourceDoc is in fact a previous TargetDoc! Obviously in this case there will be no code modules associated with TargetDoc, but I want to find a way of learning that this is a TargetDoc. Hence an earlier post about CustomProperties. The idea is to create for the SourceDoc a set of CustomProperties that would include the Version of CodePrint, the date of the CodePrint run, and the name of the TargetFile created. The Target file would have a similar set of properties, plus an indication that this is an output file, and so should not be used as a source file.
OK - this research is under way - and already it seems that the various Office Apps have different ways of dealing with Document Properties. Well - consistency is perhaps not Microsoft's strongest point. The second area where I'm running into problems is getting access to the VBE. Before I go too far down this path (which I have trodden once before, but some time ago), I would be interested in learning if the VBE is common and consistent across all the Office apps, or whether this is yet another area where different apps have different approaches.
Of course - someone may already have done this (if so, a pointer would be helpful), which would make this exercise of limited interest except as a research project.
So, bottom line, I have two questions:
1) Is there any good source for learning how the different Office apps can handle a common way of dealing with Custom Properties, and if not, what is the best way of adding these few properties to an Office file?
2) Are there any known inconsistencies between the VBE for different Office apps? I'm assuming (dangerous..) that the structure of the VBE is pretty consistent over different versions, but how about between applications?
Any pointers will be gratefully welcomed!
Tony
Bookmarks