How can i anchor points on my .docx template file to dump my variable strings?Merging docx files together including headers, footers and picturesWhat are the available 3rd party options to a) modify a templated word document b) convert a docx to pdfFind and replace text in .docx file - PythonPHP Email Attachment pdf and docx files don't get sent properlyRead and Write DOCX fileKnitting RMarkdown to Word loses internal anchorsCan you modify only a text string in an XML file and still maintain integrity and functionality of .docx encasement?Displaying a PDF in <object> tag in CodeIgniter viewHow to store substrings from .docx to java bean class?Splitting a docx by headings into separate files in Python

Why isn't there any 9.5 digit multimeter or higher?

Will this creature from Curse of Strahd reappear after being banished?

What steps would an amateur scientist have to take in order to get a scientific breakthrough published?

What are the cons of stateless password generators?

How to store my pliers and wire cutters on my desk?

Why is it considered acid rain with pH <5.6?

Is it okay for me to decline a project on ethical grounds?

How can I kill my goat?

Why were contact sensors put on three of the Lunar Module's four legs? Did they ever bend and stick out sideways?

Is there a way to know the composition of a Team GO Rocket before going into the fight?

8086 stack segment and avoiding overflow in interrupts

Can a US President, after impeachment and removal, be re-elected or re-appointed?

reconstruction filter - How does it actually work?

Polyhedra, Polyhedron, Polytopes and Polygon

Why didn’t Christianity spread southwards from Ethiopia in the Middle Ages?

Why does this RX-X lock not appear in Extended Events?

What is this 4 sharp symbol and what does it mean?

Anti-cheating: should there be a limit to a number of toilet breaks per game per player?

How did the SysRq key get onto modern keyboards if it's rarely used?

Nested keyval proper parsing

Is there a word to describe someone who is, or the state of being, content with hanging around others without interacting with them?

Why did I lose on time with 3 pawns vs Knight. Shouldn't it be a draw?

Can you place a support header in the ceiling?

Why use the "finally" keyword?



How can i anchor points on my .docx template file to dump my variable strings?


Merging docx files together including headers, footers and picturesWhat are the available 3rd party options to a) modify a templated word document b) convert a docx to pdfFind and replace text in .docx file - PythonPHP Email Attachment pdf and docx files don't get sent properlyRead and Write DOCX fileKnitting RMarkdown to Word loses internal anchorsCan you modify only a text string in an XML file and still maintain integrity and functionality of .docx encasement?Displaying a PDF in <object> tag in CodeIgniter viewHow to store substrings from .docx to java bean class?Splitting a docx by headings into separate files in Python






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I am trying to find the right approach to insert text that is stored in variables in to a docx template file stored in the same directory as my app for gathering the data strings.



I looked at abusing the mail merge work arounds in word but that seems to be a lot more locked down in later versions of office...i have 365.



the python.docx module seems clunky for what i need using runs etc...



How can i anchor points on the template to dump my variable strings?



i might add that the template has a lot of borders and boxes around each section and spans 2 pages.



would it be easier to do if my doc was a pdf?



what other file format would be a better match for what i want to do?










share|improve this question


























  • I've had luck using the XLWT module: pypi.org/project/xlwt

    – Hoog
    Mar 26 at 19:50











  • XLWT seems to be only for excel files or i am i missing something?

    – Yan
    Mar 26 at 23:45











  • It is, I misunderstood what you needed.

    – Hoog
    Mar 27 at 11:33

















1















I am trying to find the right approach to insert text that is stored in variables in to a docx template file stored in the same directory as my app for gathering the data strings.



I looked at abusing the mail merge work arounds in word but that seems to be a lot more locked down in later versions of office...i have 365.



the python.docx module seems clunky for what i need using runs etc...



How can i anchor points on the template to dump my variable strings?



i might add that the template has a lot of borders and boxes around each section and spans 2 pages.



would it be easier to do if my doc was a pdf?



what other file format would be a better match for what i want to do?










share|improve this question


























  • I've had luck using the XLWT module: pypi.org/project/xlwt

    – Hoog
    Mar 26 at 19:50











  • XLWT seems to be only for excel files or i am i missing something?

    – Yan
    Mar 26 at 23:45











  • It is, I misunderstood what you needed.

    – Hoog
    Mar 27 at 11:33













1












1








1








I am trying to find the right approach to insert text that is stored in variables in to a docx template file stored in the same directory as my app for gathering the data strings.



I looked at abusing the mail merge work arounds in word but that seems to be a lot more locked down in later versions of office...i have 365.



the python.docx module seems clunky for what i need using runs etc...



How can i anchor points on the template to dump my variable strings?



i might add that the template has a lot of borders and boxes around each section and spans 2 pages.



would it be easier to do if my doc was a pdf?



what other file format would be a better match for what i want to do?










share|improve this question
















I am trying to find the right approach to insert text that is stored in variables in to a docx template file stored in the same directory as my app for gathering the data strings.



I looked at abusing the mail merge work arounds in word but that seems to be a lot more locked down in later versions of office...i have 365.



the python.docx module seems clunky for what i need using runs etc...



How can i anchor points on the template to dump my variable strings?



i might add that the template has a lot of borders and boxes around each section and spans 2 pages.



would it be easier to do if my doc was a pdf?



what other file format would be a better match for what i want to do?







python-3.x docx






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 26 at 23:47







Yan

















asked Mar 26 at 19:46









YanYan

346 bronze badges




346 bronze badges















  • I've had luck using the XLWT module: pypi.org/project/xlwt

    – Hoog
    Mar 26 at 19:50











  • XLWT seems to be only for excel files or i am i missing something?

    – Yan
    Mar 26 at 23:45











  • It is, I misunderstood what you needed.

    – Hoog
    Mar 27 at 11:33

















  • I've had luck using the XLWT module: pypi.org/project/xlwt

    – Hoog
    Mar 26 at 19:50











  • XLWT seems to be only for excel files or i am i missing something?

    – Yan
    Mar 26 at 23:45











  • It is, I misunderstood what you needed.

    – Hoog
    Mar 27 at 11:33
















I've had luck using the XLWT module: pypi.org/project/xlwt

– Hoog
Mar 26 at 19:50





I've had luck using the XLWT module: pypi.org/project/xlwt

– Hoog
Mar 26 at 19:50













XLWT seems to be only for excel files or i am i missing something?

– Yan
Mar 26 at 23:45





XLWT seems to be only for excel files or i am i missing something?

– Yan
Mar 26 at 23:45













It is, I misunderstood what you needed.

– Hoog
Mar 27 at 11:33





It is, I misunderstood what you needed.

– Hoog
Mar 27 at 11:33












1 Answer
1






active

oldest

votes


















0














I have found a tutorial posted by Chris Moffitt that uses lxml package to use a form of mail merge with word templates.



https://pbpython.com/python-word-template.html



This is exactly what i was after. It uses "quick parts" to form an anchor in the word template so that i can replace them later using python code in sections of my document.






share|improve this answer
























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55365168%2fhow-can-i-anchor-points-on-my-docx-template-file-to-dump-my-variable-strings%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    I have found a tutorial posted by Chris Moffitt that uses lxml package to use a form of mail merge with word templates.



    https://pbpython.com/python-word-template.html



    This is exactly what i was after. It uses "quick parts" to form an anchor in the word template so that i can replace them later using python code in sections of my document.






    share|improve this answer





























      0














      I have found a tutorial posted by Chris Moffitt that uses lxml package to use a form of mail merge with word templates.



      https://pbpython.com/python-word-template.html



      This is exactly what i was after. It uses "quick parts" to form an anchor in the word template so that i can replace them later using python code in sections of my document.






      share|improve this answer



























        0












        0








        0







        I have found a tutorial posted by Chris Moffitt that uses lxml package to use a form of mail merge with word templates.



        https://pbpython.com/python-word-template.html



        This is exactly what i was after. It uses "quick parts" to form an anchor in the word template so that i can replace them later using python code in sections of my document.






        share|improve this answer













        I have found a tutorial posted by Chris Moffitt that uses lxml package to use a form of mail merge with word templates.



        https://pbpython.com/python-word-template.html



        This is exactly what i was after. It uses "quick parts" to form an anchor in the word template so that i can replace them later using python code in sections of my document.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 27 at 18:09









        YanYan

        346 bronze badges




        346 bronze badges





















            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







            Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55365168%2fhow-can-i-anchor-points-on-my-docx-template-file-to-dump-my-variable-strings%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript