Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-22-2011, 08:37 AM
Andy2011 Andy2011 is offline FILLIN function Windows Vista FILLIN function Office 2007
Novice
FILLIN function
 
Join Date: Jul 2011
Posts: 9
Andy2011 is on a distinguished road
Default 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).
Reply With Quote
  #2  
Old 07-22-2011, 04:56 PM
macropod's Avatar
macropod macropod is offline FILLIN function Windows 7 64bit FILLIN function Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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.
Attached Files
File Type: docx FILLIN.docx (20.0 KB, 9 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 10-14-2011, 04:42 AM
Skarab Skarab is offline FILLIN function Windows 7 FILLIN function Office 2003
Novice
 
Join Date: Jun 2010
Posts: 9
Skarab is on a distinguished road
Default

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?
Reply With Quote
  #4  
Old 10-14-2011, 05:06 AM
macropod's Avatar
macropod macropod is offline FILLIN function Windows 7 64bit FILLIN function Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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
where 'Property_Name' is your custom property's name. You can then use DOCPROPERTY fields throughout the document to point to that custom property and retrieve its contents. Do note that, if the user disables the macro when the document is opened, the update process won't occur.

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]
Reply With Quote
  #5  
Old 10-14-2011, 05:22 AM
Skarab Skarab is offline FILLIN function Windows 7 FILLIN function Office 2003
Novice
 
Join Date: Jun 2010
Posts: 9
Skarab is on a distinguished road
Default

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.
Reply With Quote
  #6  
Old 10-14-2011, 05:47 AM
macropod's Avatar
macropod macropod is offline FILLIN function Windows 7 64bit FILLIN function Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #7  
Old 10-14-2011, 06:24 AM
Skarab Skarab is offline FILLIN function Windows 7 FILLIN function Office 2003
Novice
 
Join Date: Jun 2010
Posts: 9
Skarab is on a distinguished road
Default

Sorted!
I knew I was missing something. Thank you very very much
Reply With Quote
  #8  
Old 10-14-2011, 09:10 AM
Skarab Skarab is offline FILLIN function Windows 7 FILLIN function Office 2003
Novice
 
Join Date: Jun 2010
Posts: 9
Skarab is on a distinguished road
Default

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.
Reply With Quote
  #9  
Old 10-14-2011, 05:29 PM
macropod's Avatar
macropod macropod is offline FILLIN function Windows 7 64bit FILLIN function Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #10  
Old 10-19-2011, 02:51 PM
Skarab Skarab is offline FILLIN function Windows 7 FILLIN function Office 2003
Novice
 
Join Date: Jun 2010
Posts: 9
Skarab is on a distinguished road
Default

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
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
if function help jim831 Excel 2 10-29-2010 07:06 PM
FILLIN function Can't get AND function working Scaffold Excel 6 07-09-2010 01:41 AM
FILLIN function FIND function, where? Yumin Word 2 04-02-2010 07:16 PM
FILLIN function Is this possible using the Vlookup or any other function? Delson Excel 4 02-08-2010 01:27 PM
FILLIN function Need help on what function to use??? Primeraman Excel 1 06-13-2006 10:16 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:38 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft