Generating a Word document: Is it possible to populate a Microsoft Word template with values from an SAP system?
Yes, this is possible. There are two alternatives:


Create an MS Word document and save it as .rtf file. Use &[xxx] expressions for the GuiXT variables that you want to have replaced. Tables are possible as well.
For example, you create a "risk assessment template" called "Risk_Assessment.rtf" where you want to insert the values from a notification within SAP. You use &[xxxx] expressions throughout the "Risk_Assessment.rtf" template and then the commands below to populate the template with the required SAP field values, and then open it

CopyText toText="Notif_Risk"   fromTemplate="Risk_Assessment.rtf"

CopyText fromText="Notif_Risk toFile="C:Completed_Risk_Assessemnt.rtf"

Start "C:\Completed_Risk_Assessemnt.rtf"

In the rtf template, when you write the &[xxx] expressions, please observe that you do not use different font/color within the &[xxx] expression; otherwise GuiXT does not recognize it. You may use any font you like, but do not change the font within the &[xxxx] expression.

Components required for (1): InputAssistant

Optionally you can embed the rtf display into the SAP GUI window (GuiXT Viewer component).  


Use the Word automation interface as decribed in GuiXT Controls Tutoral 3.

Components required for (2): InputAssistant + GuiXT Controls

Approach (2) is more flexible but for many applications (1) will do, and it is easier to implement.