Hello again
thank you for the offer. Attached is the file "A_Flet.doc" (actually my file is called "A_Flet.dot" but I had to change the extension to .doc in order to upload it).
I am working on a web-application where users log in to perform "case handling" tasks. One of the things they can do is generate a word file which they can print and send as a letter to a client.
The word file is to contain some information the user enters and some information which is generated by the application. The users belong to a "user-group", and each user-group has some specific formatting requirements which the application reads and sets in the word document. Margins and foot text and so on.
The word-document is to be based on a template (.dot) file which the customer supplies. The template file contains bookmarks for which the application is to set the text. Some of the text for the bookmarks comes from the user, some text is generated by the application according to the user's user-group. (The .dot file is from a "legacy application" which the customer is in the process of replacing).
For example, there is a bookmark called "AfdInfo", which means "branch information". Here, the application finds information relevant to the user-group, and sets the bookmark text to an address (from-company, telephone number, etc). But this bookmark is also contained in a "frame", and each user-group has specific requirements to the horizontal and vertical position of the frame. I need to be able to set these values.
Likewise for bookmarks called "Modtager" (recipient), "Bundtekst" (footer text), "Vedrørende" (concerning)... and so on.
I also have to set document-wide page-setup, like margins for top, left, right, and bottom. This I think I have found out by iterating over all the Sections and using PageSetup. The only thing is that "top margin" is supposed to be different on the "first page" and "other pages".
Sorry for the long description, and many thanks,
Peter