Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-13-2011, 08:40 AM
Skarab Skarab is offline creating a custom field and using it in a template Windows 7 creating a custom field and using it in a template Office 2003
Novice
creating a custom field and using it in a template
 
Join Date: Jun 2010
Posts: 9
Skarab is on a distinguished road
Default creating a custom field and using it in a template

Hi all,



I am working on creating a report template which can be applied to a number of different "sites". I would like to run a Macro on template start which prompts the user to enter the site name. the macro would look like this:

Private Sub Workbook_Open()
InputBox ("Enter site name")
End Sub

I would like to write this site name into a field which I can place throughout the body of the document (sort of like a cell or name reference in excel).

Can anyone help me with the additional code required and the creation of a custom field from this code?

Alternatively, if there's an easier way to do this I'd love to hear it.

Many thanks!
Reply With Quote
  #2  
Old 10-16-2011, 01:26 PM
jujuwillis's Avatar
jujuwillis jujuwillis is offline creating a custom field and using it in a template Windows XP creating a custom field and using it in a template Office 2010 32bit
Advanced Beginner
 
Join Date: Apr 2006
Location: Dunstable, England
Posts: 77
jujuwillis is an unknown quantity at this point
Default Use Fields FILL IN & REF, Use of bookmark

One option you could choose is to have your Site Name as a FILL IN field, select this field and and set a bookmark. Then use the REF field to include the bookmark.

Use Control + A to select the document and Alt + F9 to update all the fields.

When you create a new document from your template it will bring up the FILL IN Field dialog box.
Reply With Quote
  #3  
Old 10-24-2011, 02:38 AM
Skarab Skarab is offline creating a custom field and using it in a template Windows 7 creating a custom field and using it in a template Office 2003
Novice
creating a custom field and using it in a template
 
Join Date: Jun 2010
Posts: 9
Skarab is on a distinguished road
Default

Quote:
Originally Posted by jujuwillis View Post
One option you could choose is to have your Site Name as a FILL IN field, select this field and and set a bookmark. Then use the REF field to include the bookmark.

Use Control + A to select the document and Alt + F9 to update all the fields.

When you create a new document from your template it will bring up the FILL IN Field dialog box.
Thanks Juju, that's exactly what i had in mind. my problem is that i don't know how to take the user input into the pop-up box and write it to the FILL IN field using code.
Reply With Quote
  #4  
Old 10-24-2011, 03:33 AM
jujuwillis's Avatar
jujuwillis jujuwillis is offline creating a custom field and using it in a template Windows XP creating a custom field and using it in a template Office 2010 32bit
Advanced Beginner
 
Join Date: Apr 2006
Location: Dunstable, England
Posts: 77
jujuwillis is an unknown quantity at this point
Default

Example of Document attached, you will need to save it as a template
Attached Files
File Type: doc Report for Site Name.doc (56.5 KB, 15 views)
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating document from template but macros are still linked to template webharvest Word 0 07-16-2011 09:34 AM
Creating a custom transition speed? watsonstudios PowerPoint 0 05-20-2011 08:17 PM
Add custom field to print style steino Outlook 0 03-31-2011 12:03 PM
Creating A Input Or Output Field skoz55 Excel 0 08-15-2009 04:40 PM
Custom Fields : Creating New Field Types. KarthikR Word 0 12-04-2005 12:47 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:28 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