none
Template components not working in new documents RRS feed

  • Question

  • Hi all,

    I have created a document to act as a form and contains several buttons and a number of text boxes and drop down lists.  the drop down lists have been populated with the desired input options etc.  The buttons all have VBA code behind them and all seems to work well.  I saved the document as a macro enabled template (.dotm).  However, when I double click on the template a new document does open and all the texts and buttons are present but the text boxes have the value that was set when i saved the document as a template, and the drop down lists have the value selected when the document was saved as a template.  Furthermore they cannot be selected as drop downs or edit boxes.  What is going wrong here please?  When the new document opens it does have the "compatibility mode" on the title bar and I remove this by selecting File >> Convert but the edit boxes and drop down lists remain just as text.  How can I resolve this please?

    Thanks

    Tuesday, October 10, 2017 12:03 PM

All replies

  • Hi alanjo,

    you said that you had created a macro enabled template.

    but when you double click on template. it create a new document.

    you can check that this document is normal .docx document.

    which does not contains any code that you had wrote for the controls.

    because of this reason you are not able to see the values inside dropdown and not able to change it.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, October 11, 2017 3:25 AM
    Moderator
  • If your buttons, text boxes and drop down lists are content controls or formfields, they should all work unless any macros they interact with have been written to address 'ThisDocument' instead of 'ActiveDocument' or some other coding deficiency. They will, of course, default to whatever values they had when you created the template.

    If your buttons, text boxes and drop down lists are ActiveX controls, they won't work unless your template also has code to populate and interact with them.


    Cheers
    Paul Edstein
    [MS MVP - Word]

    Wednesday, October 11, 2017 3:43 AM
  • you said that you had created a macro enabled template.

    but when you double click on template. it create a new document.

    you can check that this document is normal .docx document.

    which does not contains any code that you had wrote for the controls.

    because of this reason you are not able to see the values inside dropdown and not able to change it.


    That might be so for ActiveX controls but it isn't so for content controls or formfields. Macros in a template continue to apply to any content controls or formfields in a docx file created from the template.

    Cheers
    Paul Edstein
    [MS MVP - Word]

    Wednesday, October 11, 2017 3:47 AM
  • Hi alanjo,

    is your issue is solved now?

    I find that after creating this thread, you did not done any follow up.

    so if your issue is solve then I suggest you to post the solution and mark it as an answer.

    if your issue is still pending then I suggest you to refer the suggestions given by community members.

    it may help you to solve your issue.

    if then also you have any further question then let us know about that.

    We will try to provide further suggestions to solve the issue.

    thanks for your understanding.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, November 1, 2017 6:46 AM
    Moderator