Results 1 to 11 of 11
  1. #1
    New Lounger
    Join Date
    Nov 2005
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I am trying to create a simple word template that prompts a user for basic information such as type of document, how to distribute the file and who to distribute to, review date and effective from date.

    I first tried with the fillin fields but as the data goes into the header or footer, it all got very messed up.

    So after some searching I tried the ASK field and added the field, a bookmark, a ref field after the ask field and inserted a autonew macro.

    Result I open document based on template and no prompts.

    I cannot believe this is so hard for such a simple task.

    I have attched my result document in the hope someone can point me in the right direction, or point me in the direction of a user guide for the task. I have not found one myself.

    the macro added to the template was this

    Sub AutoNew()

    Dim Fld As Field

    ActiveDocument.Fields.Update

    For Each Fld In ActiveDocument.Fields
    If Fld.Type = wdFieldAsk Or Fld.Type = wdFieldFillIn Then
    Fld.Unlink
    End If
    Next Fld

    End Sub



    Thank you for any help.
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts
    You need to put the ASK field in the body of the document and use a REF field in the Header that references the bookmark defined in the ASK field.

    See MSKB article 89863

  3. #3
    New Lounger
    Join Date
    Nov 2005
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok i now get the new doc to open with the prompt but the results of the answers are not going in my bookmarked places.

    Here is the revised doc2
    Attached Files Attached Files

  4. #4
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts
    [quote name='greenoak' post='792774' date='10-Sep-2009 10:08']Ok i now get the new doc to open with the prompt but the results of the answers are not going in my bookmarked places.

    Here is the revised doc2[/quote]
    This document does not prompt me to enter data, and I cannot see any ASK fields in the document body, just empty paragraphs. Please check that you posted the correct document.

  5. #5
    New Lounger
    Join Date
    Nov 2005
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I just dont get this at all.

    I started again.

    I put all the ask field in the body of the doc
    i added bookmarks to use in the doc
    i added ref fields in header and footer
    i added a autonew macro to template

    when i open a new file based on template I am asked the questions, but nothing appears in the new doc and the ask fields are not in the body.

    What am I doing wrong.

    happy to email you the template as I cannot attach it.

  6. #6
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts
    You can attach the template if you ZIP it first.

  7. #7
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts
    In your original post you showed a macro, that includes the following...
    Code:
    	For Each Fld In ActiveDocument.Fields 
    		 If Fld.Type = wdFieldAsk Or Fld.Type = wdFieldFillIn Then 
    			Fld.Unlink 
    		 End If 
    	  Next Fld
    If you unlink a field, that will replace the field code with it's current result, but the result of an ASK field is always blank (it doesn't display in the document), so this fld.Unlink deletes the ask field.

    What are you trying to achieve? It might be easier to create a userform that prompts the user for information you want instead of using an ASK field.

  8. #8
    New Lounger
    Join Date
    Nov 2005
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    here is the zipped template.

    I just want a simple word temnplate that asks a few simple questions before the user creates the doc.

    This will then become a sharepoint new word template.

    I would love it to be a autoform but I dont have those skills. If I did I would have a drop down list for document types that matches my sharepoint doc type.

    Whilst I am at it I want the title field to get updated as soon as the file is saved, rather than ahving to do print preview to update it.

    thanks
    Attached Files Attached Files

  9. #9
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts
    There is a simple example of how to create a userform that opens when a new document is created based on a template in Post 259183

    See if you can customize this to meet your needs.

    ALSO please do some early testing to make sure this does what you expect when you host it on a SharePoint site. I am not a SharePoint expert, but I have come across issues running Macros from templates hosted on SharePoint.

  10. #10
    New Lounger
    Join Date
    Nov 2005
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I Have Scrapped The Ask Field Route And Redone Using a UserForm and slowly getting there. I found a resonable guide at word.mvps.org

  11. #11
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts
    [quote name='greenoak' post='792813' date='10-Sep-2009 15:37']I Have Scrapped The Ask Field Route And Redone Using a UserForm and slowly getting there. I found a resonable guide at word.mvps.org[/quote]
    Great, this will be much more reliable for you in the long term.

    Let us know if you run into problems and we can try to help you.

Posting Permissions

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