Word Automation, How to?

I know that it is possible, but I have no idea how it works. Could anyone give me step-by-step hints how I could manage it to make a word document from a sales quote (or something similar)? Regards

Do you have Navision’s Product-CD? If you do, please look in the Doc folder. You will find a file named w1w1adg.pdf. This is the PDF-Manual “Application Designer’s Guide”. Scroll down to chapter “16.3 USING C/SIDE AS AN AUTOMATION CONTROLLER” where you can follow a basic example: “Writing a Letter In Microsoft Word”. If you don’t have the Product-CD, you may download the contents of the Doc folder from this link (version 3.70): http://www.mibuso.com/dlinfo.asp?FileID=267 Also, you can find a lot more info by searching the forum for word automation.

Nelson, thank you for your response but yes, I ´ve got the product CD and yes, I studied the particular example. But this example stays barely on the top of subject. I really can´t find a solution for my task to create word documents from a Navision sales document with all of it´s implications. And I already searched the forum for further entries and didn´t find in deepth information on this. So what I´m looking for is a more detailed view on the subject, especially how the word automation object model is to be controlled by Navision, how to create and instanciate the objects of this model and how to call the objects methods and not only the few which are mentioned in the example.

Josef, I’m afraid the best way to learn about Word automation is by trial and error. Intially, to learn about the properties and methods I use the Word DOM (find this at http://msdn.microsoft.com/). You could also record macros in Word documents - this will help you with specific tasks that you can do from within the Word program. If you are still struggling with this, I looked at a few delphi code sites which talk about Word automation, and these helped me as well. Try; http://www.djpate.freeserve.co.uk/Automation.htm Good luck … hope this helps

Josef, I have done what you are describing and I can save you a lot of time. Forget it. Word is the wrong tool for creating an order. The merge of data between Navision and Word Automation is dog slow. It’s okay if you want to write a letter and plug in just a couple of fields, but the quantity of data coming from an order AND the variable nature of the lines make it very complex. However, the automation link to Excel is pretty darn snappy. If you want to dump the order data to Excel and then play in VB for Apps that may be an option that will give you some practice in Automation with online help that provides contextual prompting. The best approach for exporting order information and transmitting it electronically is by running a report to a virtual printer that creates a PDF file. Check the references to PDF995 in this forum for more information. The previous post about trial and error is very true. Navision has really done a poor job of giving developers documention on the desktop integration of the Navision development environment with Automation, OCX, Cfront, Navision Application Server, etc. Good Luck,

Connull, Mark thanks for your contributions. We will have to think about the whole subject in a way of “do it with Word” or “do nothing” because the demand is a one-click-solution: A single button-click in Navision should open Word with the respective document already inserted so that the sales people can draw their individual paintings around it. The question will be if the customer can pay the efforts we have to make to reach this goal. Regards

Josef, From what you are asking about, automation of MSWord will work and it will be fairly easy to achieve. We have several systems that use MSWord and MSExcel automation controllers, and they work fine. It should work for you … good luck

A alternative to MSWord Automation now exists, beginning with Word 2003 – use XML to generate the document, targeting the WordProcessingML schema… Here’s an MSDN blog post that gives some great hints… http://blogs.msdn.com/dotnetinterop/archive/2005/03/29/403331.aspx