none
Auto Macro Fill in word 2010 RRS feed

  • Question

  • Hi

    I have a question on Marco and VBA. I’m totally new.

    We have forms in word Marco. I want a code that will fill name from %userprofile% and signature (saved signature) automatically.   What I want to achieve is when users open the form it will automatically fill their name (logon name) and signature. Is it possible at all?

    Tuesday, June 24, 2014 2:48 AM

All replies

  • Hi,

    This is the forum to discuss general questions and feedback for Microsoft Office Client, better to post your question to the forum of Microsoft Office for Developers:

    http://social.msdn.microsoft.com/Forums/office/en-US/home?forum=worddev

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.

    Thanks,

    Ethan Hua CHN
    TechNet Community Support

    Wednesday, June 25, 2014 2:24 AM
  • Hi,

    Based on the description, you want to sign the signature automatically when user open a user form and the signature is added before? As far as I know, there are two ways to sign a Word document. First is adding an invisible digital signatures and the second is adding a signature line. Did you want to sign the signature line added before automatically?

    If I understood correctly, I am afraid we can’t achieve the goal. Because when we add a signature line into Word document, we can’t get it again except you return a signature object after you inserted.

    In addition, we can get the current user name by Environ$("Username"). And you can get more detail about digital signature from link below:
    Add or remove a digital signature in Office files

    Hope it is helpful.

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, June 25, 2014 7:54 AM
    Moderator
  • For the Username, you could probably use a USERNAME field (see Insert|Quick Parts>Field>Username). It's not clear though what kind of signature you mean. Is it an image file (e.g. a jpg image) stored somewhere and with a name that a macro could automatically recognise (e.g. an image in a common folder where images of all users' signatures are stored [dangerous] or in some other readily recognised folder tied to the user's account and still with a readily-recognised name)?

    Cheers
    Paul Edstein
    [MS MVP - Word]

    Wednesday, June 25, 2014 10:16 AM