Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    New Lounger
    Join Date
    Jun 2008
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    URGENT HELP WITH ASK AND FILLIN FIELDS (WORD 2003)

    I have previously sent a post but still having lots of problems. I have search heaps of sites but every time I work something out something else goes wrong. So I am trying again, I need to (desperately) create a template where I will have ASK/REF and FILLIN fields, when someone opens this template I want these fields to prompt the user what info is required. I believe I need an AutoOpen macro to activate the ASK field, possibly an AutoNew (not sure). Also I need a macro which I could assign to a button to update REF field in header. I have found information on the internet for an AutoOpen macro but they are all different. I would really appreciate any help or if I can get information that will help me achieve what I am trying to do.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: URGENT HELP WITH ASK AND FILLIN FIELDS (WORD 2003)

    Since this is a follow-up to <post:=718,492>post 718,492</post:> it would have been better to post your question in that thread.

    Create the following macro (originally from Word MVP Greg Maxey, I think) in a standard module in the template:

    Sub UpdateAllFields()
    Dim rngStory As Word.Range
    Dim oShp As Word.Shape
    For Each rngStory In ActiveDocument.StoryRanges
    Do
    On Error Resume Next
    rngStory.Fields.Update
    Select Case rngStory.StoryType
    Case 6 To 11
    If rngStory.ShapeRange.Count > 0 Then
    For Each oShp In rngStory.ShapeRange
    If oShp.TextFrame.HasText Then
    oShp.TextFrame.TextRange.Fields.Update
    End If
    Next oShp
    End If
    End Select
    On Error GoTo 0
    ' Get next linked story (if any)
    Set rngStory = rngStory.NextStoryRange
    Loop Until rngStory Is Nothing
    Next rngStory
    End Sub

    Create the following code in the ThisDocument module in the template:

    Private Sub Document_New()
    Call UpdateAllFields
    End Sub

    Private Sub Document_Open()
    Call UpdateAllFields
    End Sub

  3. #3
    New Lounger
    Join Date
    Jun 2008
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: URGENT HELP WITH ASK AND FILLIN FIELDS (WORD 2

    thanks your help. still not working, I'm really not that good with code as I am never sure where to enter the information. I tried but still got nowhere. is it possible to show me a sample if possible, greatly appreciated?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: URGENT HELP WITH ASK AND FILLIN FIELDS (WORD 2

    I have attached a template Sample.dot (zipped) with an Ask field and the code.
    Attached Files Attached Files

  5. #5
    New Lounger
    Join Date
    Jun 2008
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: URGENT HELP WITH ASK AND FILLIN FIELDS (WORD 2

    Hi HansV, I did try your attachment but encountered the same problems as previous when I inserted Fillin fields to the template and the prompts wouldn't work. Anyway, I have almost got it to work, the only problem at this stage (probably will find something else later) is that the first prompt it gives me is the Fillin and then the ASK field, the first prompt in this template is the ASK field. Why does it do that, any idea. I have created a macro to update my header and footer and then assigned it to a toolbar and it works fine, probably not the way to do it but it is working now, any suggestions. See attachment hopefully this will be clearer.
    Attached Files Attached Files

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: URGENT HELP WITH ASK AND FILLIN FIELDS (WORD 2

    When I create a new document from your template, the AutoNew macro is executed (I checked this by inserting a MsgBox statement). Are you sure that macros are enabled?

    If you want better control over the way the user provides values, I would use a userform as in the post that I referred to in my first reply, instead of using Ask and Fillin fields.

  7. #7
    New Lounger
    Join Date
    Jun 2008
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: URGENT HELP WITH ASK AND FILLIN FIELDS (WORD 2

    Thanks for your advise.I have never used userform, do you have to lock them for user to use? This is not a form but a report template which users will need to enter their own information. What I am trying to do is set it up so that the structure of the report is created for the users. How can I check that macros are enabled, I thought they were? Could try userforms but would need to know more as I am running out of time, have wasted so much time already but am happy to try it. Thanks heaps for all your help.

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: URGENT HELP WITH ASK AND FILLIN FIELDS (WORD 2

    A userform can be used to let the user enter information in a convenient way. You can then place the information in the document.

    However, userforms are not a subject to tackle in an afternoon, so if you already have a solution even if it isn't perfect, I'd stick with it for the moment.

    Perhaps you can read up on userforms for your next project, see for example VBA Tips: Word UserForms (a three-part tutorial with a downloadable sample).

  9. #9
    New Lounger
    Join Date
    Jun 2008
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: URGENT HELP WITH ASK AND FILLIN FIELDS (WORD 2

    thanks so much for your advise, I have had a quick look to Userforms, looks good. Will certainly tackle them later on. It's now way pass my bed time. So thanks again for everything, I have a solution for now but will certainly look at userforms very soon. thanks again!

  10. #10
    New Lounger
    Join Date
    Jun 2008
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: URGENT HELP WITH ASK AND FILLIN FIELDS (WORD 2

    I have created a userform and looking really good, it is only a basic userform will continue to develop this as I go along. I have a slight problem and cannot find a soulation. I have created bookmarks and cross-reference and all works ok. The problem is that I have included a cross-reference in a footer and it won't format it to a small font size, I have changed it in the footer style, manually changed it in the footer, it just won't reformat, where as I have been able to reformat the header wihout a problem, any suggestions?

  11. #11
    New Lounger
    Join Date
    Jun 2008
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: URGENT HELP WITH ASK AND FILLIN FIELDS (WORD 2

    I searched this great site and have found a solution changed [REF date * MERGEFORMAT] to [ REF date * CHARFORMAT ] which is good but is it possible to format the date to ddddmmmmyyyyy format.

  12. #12
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: URGENT HELP WITH ASK AND FILLIN FIELDS (WORD 2

    To format the result of a field, use a date "picture." This article probably duplicates the help file, but it's easy to link to: Date-Time Picture (@) field switch - Word @ Microsoft Office Online.

  13. #13
    New Lounger
    Join Date
    Jun 2008
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: URGENT HELP WITH ASK AND FILLIN FIELDS (WORD 2

    I am having problems with my footer, for some strange reason my footer won't update it worked once or twice and now it has stopped working, everything else gets update but not my footer. I want to create a footer with a cross-reference of student name and current date. I want to automate this either with a macro or vb code and assign it to a customised toolbar which users will click to update.

  14. #14
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: URGENT HELP WITH ASK AND FILLIN FIELDS (WORD 2

    The macro that I posted should update all fields, including those in the footer, so it's hard to know what causes the problem without seeing the document/template.

  15. #15
    New Lounger
    Join Date
    Jun 2008
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: URGENT HELP WITH ASK AND FILLIN FIELDS (WORD 2

    Finally worked out what the problem was. The macro does update the cross-reference but doesn't show headers/footers in print layout view. It shows the details once you have been to print preview. I added print preview code to the macro and now it works. But still have a problem, I have a date bookmark in my userform (textbox), I then enter the date but in the bookmark location it enters todays date and in the cross-reference it enters the date typed in the bookmark. How do I fix this problem. I want the date to only enter what I enter and I want to format that date (bookmark) to date, month, year. Hope you can understand what I am trying to do?

Page 1 of 2 12 LastLast

Posting Permissions

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