#1
|
|||
|
|||
FILLIN function
Hi
I have a couple of questions... 1 - How do you include the Prompt Text with the response that is entered? 2 - Can the response be formatted so that the response appears on a line below the Prompt? 3 - Can the prompt be displayed in Bold Format when entered? 4 - Can the responses be concatenated when entered, in a particular format? Simple example shown below...(this is what I would like the finished response to look like when entered... Prompt #1 ----> 1. Reference Number Prompt #2 ----> Date When entered, displayed as 1. Reference Number and Date <------ (In BOLD Font) XXXXXX/22JUL11 <---- (In Regular Font) (where X = alphanumeric, date formatted as displayed). |
#2
|
||||
|
||||
Hi Andy,
Are you familiar with FILLIN fields? 1. You can specify a default response by coding the field along the lines of: {FILLIN "Please Input Something" \d "Default Response"} 2. The default response appears in the input box, which is itself below the propmt. 3. The prompt cannot be displayed in a bold font (unless, perhaps you change some Windows font settings - which will affect all apps and in places where is might be undesirable). 4. You can have a line of bold text in the document with: '1. Reference Number and Date' immediately above the FILLIN field, which can also have the same prompt. The user's response can be formatted however you want it. Thus, you can have: '1. Reference Number and Date' 'XXXXXX/22JUL11' See attached.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Hi Macropod,
i'm looking to use something like this where the user is prompted to enter text into a pop-up window on start-up, and the text entered by the user is placed throughout the document body (like a field). can you help by any chance? |
#4
|
||||
|
||||
Hi Skarab,
You could do it with a macro, but not with field coding alone. And, if you're going to use a macro, I'd suggest using a custom document property with code like: Code:
Private Sub Document_Open() Dim MyProp As String, StrOld As String, StrNew As String Restart: With ThisDocument MyProp = "Property_Name" StrOld = .CustomDocumentProperties(MyProp).Value StrNew = InputBox("What is the variable?", "Update " & MyProp, StrOld) If StrNew = "" Then MsgBox "A valid string is required.", vbCritical, "Update " & MyProp GoTo Restart End If .CustomDocumentProperties(MyProp).Value = StrNew .Fields.Update End With End Sub An alternative is to use an ASK field (preferably in the header or footer where it's less likely to be deleted by accident) to populate a bookmark and configure Word to update fields at print time. Then simply use cross-references to the ASK field's bookmark name. No code is required for this but it does depend on how each user has Word configured and the prompt will even then only occur when the document is printed.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
Hi Macropod,
Thanks for the quick response... however when i put in the code in and attempt to run it i get an "invalid procedure call or argument" runtime error (5) associated with the following line: StrOld = .CustomDocumentProperties(MyProp).Value is this because i need to create a custom field called MyProp? if so can you let me know how to do this, or fix the error? i'd be very greatful. |
#6
|
||||
|
||||
Did you create you custom doc property (and give it a value) before running the macro? And did you change the 'Property_Name' string in the macro to match the actual name?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#7
|
|||
|
|||
Sorted!
I knew I was missing something. Thank you very very much |
#8
|
|||
|
|||
Sorry to bother you again Macropod,
everything is working fine now, but i'd like to put this Macro in a template and have it run when someone opens a new document from this template... but I can't seem to do this, even using Autoexec or other similar functions. Obviously i don't what this in my normal.dot as i'd like it to be a template macro for that particular form. can you help me please? Thanks. |
#9
|
||||
|
||||
Hi Skarab,
As coded, the macro should go in the Document's 'ThisDocument' module, not in an ordinary code module. It will then run automatically when the document is opened. For use in a template, change the macro's name to 'Document_New' and put it in the Template's 'ThisDocument' module. That way, any new document created from the template will get the prompt.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#10
|
|||
|
|||
Thank you so much!
the code was already in the right place, i just needed to name it correctly. your help is very much appreciated |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
if function help | jim831 | Excel | 2 | 10-29-2010 07:06 PM |
Can't get AND function working | Scaffold | Excel | 6 | 07-09-2010 01:41 AM |
FIND function, where? | Yumin | Word | 2 | 04-02-2010 07:16 PM |
Is this possible using the Vlookup or any other function? | Delson | Excel | 4 | 02-08-2010 01:27 PM |
Need help on what function to use??? | Primeraman | Excel | 1 | 06-13-2006 10:16 AM |