Bjorn Behr wrote: > We generate a 'text/word' document from Universe. > What I would like to know is does anybody know what > characters I need to place in the document so that when > it is opened up in Word, it is in landscape format?
In order to get Word to do things you need to provide more than plain text, you need to provide specific instructions. Of course instructions need to be formatted, and there are different ways to format instructions for Word, including XML and HTML, using macros from existing Word docs/templates, or you can use Word add-ins to pump data to/from Word and U2. See an example of a product that was written (not currently offered anymore, subject to change based on "encouragement" from the market) to do this: http:// removethisNeebula-RnD .com/products/doc.htm For your purposes right now, you can use HTML as a base rather than plain text. Below this note is full HTML source which can be used as the base for a landscape document. Save this HTML page with a .DOC extension. Word will opens it, but to be considered a real Word Doc the user must SaveAs DOC. There is no getting around this: again, if you want Word to do special things you must somehow integrate with it. Rather than plain text, if you do use some method of using Word as a server and pumping data into it, then you can execute a macro like this to change the orientation: Sub SetLandscape() ActiveDocument.PageSetup.Orientation = wdOrientLandscape End Sub Combining the HTML provided below with macros, you could save your HTML as .DOC, then open Word and using command-line switches cause it to execute your macros, SaveAs DOC, then mail this final document to users. Lots of ways to skin this cat. Rather than using Universe as your base, it might make more sense to ask Universe to fire up a Windows process which will then read your text into a formatted Word document (template), perform the orientation change, then save the document where it can be used, e-mailed, etc. You can even tie this to standard Word mailmerge functions. You can still use your BASIC business rules, and data and everything else, it's just being initiated from somewhere else. For this, you can use tools like UO, UO.NET, mv.NET, or PDP.NET as the data conduit and for executing your BASIC code and returning data. My preference would be to use the more advanced features of the Visual Studio Tools for Office in conjunction with .NET, and then use mv.NET as the link to U2. I'll be happy to work on a project like this if requested. Before jumping into development, people might want to consider firing off an instance of Word every time they want to generate a document. Not only is this a very bad use of resources but it's subject to many issues. Opening an instance of Word (or other MS Office apps) in a Windows Service is a straight-forward process for someone who knows how, but there are MANY issues that need to be addressed, and Microsoft strongly discourages using these user-oriented products in a server context. Having a lot of experience in this area, I also discourage that sort of usage, and that's one of the reasons I no longer offer NebulaDoc as it was originally designed. HTH, Tony Gravagno Nebula Research and Development TG@ removethisNebula-RnD .com ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <!-- Save this file as "landscape.doc", then open with Word --> <html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"> <head> <style> <!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:11.0in 8.5in; mso-page-orientation:landscape; margin:1.25in 1.0in 1.25in 1.0in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} --> </style> </head> <body> <div class=Section1> <p class=MsoNormal>your content goes here</p> </div> </body> </html> ------- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/