Current filter:
                                You should refresh the page.
                                  • Hello Guys,

                                    i need to export an word file for a generated bill  which looks always the same but has different content from my application.

                                    My approach was as follows:

                                    I have created a Word file with several Doc variables and load this with the RichEditDocumentServer in my application. However, when I load this file, I don't get any defined fields in the document.Variables property. This list is always empty.

                                    Can you tell me if my solution was perhaps too complicated or if not why the document.Variables list is always empty.

                                    Best regards

                                • Mariya (DevExpress Support) 01.15.2020

                                  If you generated document variables in Microsoft Word using VBA (see the How to store and retrieve variables in Word documents link), these variables should be properly stored in the RichEditDocumentServer.Document.Variables collection. Would you please provide me with your document so that I can check how the variables are written? Note that you can mark this ticket private to attach your files safely.
                                  I look forward to your response.

                                • Customer121443 01.15.2020


                                  No i generate my word document with Word Application.
                                  here's my document.

                                • Mariya (DevExpress Support) 01.15.2020

                                  Thank you for the document. I checked it and noticed that it contains DocVariable fields and no variables. As I mentioned, variables can only be added in Microsoft Word using VBA. If you didn't run the VBA code as shown in the link from my previous comment, a variable will not be written in a document. Thus, the RichEditDocumentServer.Document.Variables collection is empty. If you want to obtain the DocVariable fields instead, you need to check the Document.Fields collection.

                                  Would you please clarify what exact actions you want to perform? If your task is to fill DocVariable fields with data, I recommend you follow instructions from the DocVariable topic.

                                • Customer121443 01.15.2020


                                  thanks for your support.

                                  I want to perform following actions:

                                  1. define a word template with some fields, this is only a one time thing so i want to do it the with the word application
                                  2. load this word docoument in my devexpress application and replace those fields with data from my application
                                  3. provide the created document for the use

                                  I dont know if my approach is best practice, amybe you can say me a better approach

                                  best regards

                                • Mariya (DevExpress Support) 01.15.2020

                                  Yes, your approach is fine. You can build a document template with fields using Microsoft Word, and then, fill these fields with data, and save the result using the RichEditDocumentServer library. To fill the DocVariable fields, you can use the Document.CalculateDocumentVariable event as described in the DocVariable topic. To learn more about other field types, please visit the Field Codes and Fields pages.

                                  Please let me know if I can be of more help.

                                0 Solutions

                                Creation Date Importance Sort by