Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    May 2015
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    UserForms, DocProperties, and bookmarks

    Hi Guys, Hope everyone is having a better day than me.. :0

    I'm very new to VBA and anything really to do with coding or just using word for it's basics,but starting a new job recently, I have found that I have to do a lot of Copy and Pasting of forms, and order forms and I thought if I probabaly look into it, most of the time wasted on this, could probabaly be save by looking at coding and creating automatic forms. As what they call a NEWB to this stuff I have looked around and Userforms, seem to be the best option after looking at Infopath and other Programs, but the termoinology makes it difficult for someone not so computer literate to find what they are looking for. (Must admit it's all been intresting and eye opening already). I'm stuck now and my searches are not helping. I want to create a number of documents which tend to have a lot of the same info in them but instaed of having to update on each indivual task, would like to fill out the userform and have what I need ready when the time comes. That has lead me to the attachment i have sent. I tried Bookmarks at first only to find they can only be used once and will not copy multiple times into other Pages of Doc. I have now tried looking at DocProperties, using the Quickparts menu, but when looking at the coding on some of the Tags such as Company Phone i start to get debugging errors. Is there anyone that could guide me in the right direction on useful ways of fixing or useful reads to help solve. I also would like to change the Titles of these Doc Properties but using design Mode an dproperties, also throws up issues with the code.

    Thanks for reading, and appreciate any help, I'll keep trundling through and hope i can solve this, but I thought i should ask because it looks like a helpful community out there, and this is becoming intresting to use.

    Havin a good day peeps.

    Adam
    Attached Files Attached Files
    Last edited by ADAMESKI; 2015-05-19 at 05:41.

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    Adam

    You have put in a lot of work to get where you have and you can continue down that path if you wish. Content Controls are the preferred way (IMO) rather than using fields or bookmarks and code but if the docs are being saved to doc format then you have a real problem.

    As you have discovered, the problems with using the built-in CCs linked to DocProperties are:
    1. you rapidly run out of categories
    2. the naming of properties doesn't quite line up with your intended use
    3. there are some restrictions on what can accept carriage returns and what cant
    4. the document properties are stored in several different places in the backend so coding solutions need to adapt

    To extend the number of CCs or assign better names to them, you will need to link CCs to custom XML. You can do this manually with the Word 2007 Content Control Toolkit at http://dbe.codeplex.com/. You could choose to continue to work with your coded userform and transfer those field values to an embedded xml file which links to all the CCs.

    HOWEVER...
    A non-coding solution which is much simpler is to start your document with a one page 'form' which your users can populate (so linked CCs throughout your document can be populated where needed) and then the user can simply delete this 'form'. To do this, I highly recommend you to use Greg Maxey's tool described on http://gregmaxey.mvps.org/word_tip_p...rol_tools.html
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. #3
    New Lounger
    Join Date
    May 2015
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Thank You For the Help

    Thank You for the reply, Much Appreciated and I shall look into the information you gave.

    Prior your reply I actually found a previous post, where you had helped out someone else in need, and I tried to use the code that you had helped him with. I thought I understaood what was being done, but for some reason i still seem to have problems. Looking at it, I think all the information required is there, but the Submit button does not seem to work, or close the Userform.

    I'm looking around trying to fins a simple solution, but still having trouble. I really thought this was going to work, but I may need to look into other work.

    Although you can only see 1 Document on the Attached, I was going to be adding more doc, but obviously didnt want to waste time poulating if i could not customerdocs to work.

    Any more help would be lovely while I look through your previous post, and I must say thanks very much for the reply
    Attached Files Attached Files

  4. #4
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    The submit button doesn't work because you changed the name of the button. Your current code is expecting the button to be named cmdSubmit (note the name is a different field to the caption so the name of the button doesn't have to match exactly the text displayed on it). If you select the button and press F7 it will create the right empty sub and show you where the code needs to go. Move your existing code into that sub to get that part working.

    Your tab order is all over the place on the form. Fix this by going to View>Tab Order. Ignore all the labels and rearrange all the fields into a logical flow.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  5. The Following User Says Thank You to Andrew Lockton For This Useful Post:

    ADAMESKI (2015-05-21)

  6. #5
    New Lounger
    Join Date
    May 2015
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks for the reply AGAIN.. Really appreciated, and although changing the Submit key as above now, closes the userform. Once filled out the Entries in the Userform, these do not translate to the document, and all I can see is the {DOCPROEPRTY "???"}. I'll keep reading and trying to solve the issue, knowing me and my luck so far, there is a small issue that is stopping this, but hopefully, I'll get there. Thanks for the help, I'll let you know if I succeed. Fingers Crossed

  7. #6
    New Lounger
    Join Date
    May 2015
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    ALT - F9 ...... DOHHHHH... Knew it would be something small, thank you for your help. I think I may have what I need.......

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •