Solved

Word Automation. Type in a value and update text elsewhere based upon that value

Posted on 2014-09-03
4
283 Views
Last Modified: 2014-09-03
Hi,

I am trying to create a Word template where a user enters number into an e.g. table cell and based upon that value, the text in the cell next to it us updated. E.G. Entering "100" into the first cell should automatically put the text "One hundred" into the second cell.

I already have the VBA functions which generate the "One hundred" text as I have the same sort of thing in an Access database.

How do I react to the user input in cell 1 to automatically populate cell 2? This has to work with Word 2007 (preferably Word 2003 too).

Many thanks.

M.Young
0
Comment
Question by:milesryoung
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 51

Expert Comment

by:Rgonzo1971
ID: 40300674
Hi,

you could use a ContentControl

with code in the document module

Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
    MsgBox ContentControl.Range.Text
End Sub

EE-ContentControl---Copy.txt
Replace the suffix txt with docm to open it
Regards
0
 

Author Comment

by:milesryoung
ID: 40300805
Hi, I wasn't able to open that in Word 2003. Which format is it?

I've tried using TextBoxes in the template which is actually working within the template itself but whenever I create a new document based upon that template, the textboxes aren't editable at all.

Thanks for your help
0
 
LVL 51

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 40300842
pls try

creating a new doc with my template
EE-TextBox.dot
0
 

Author Comment

by:milesryoung
ID: 40300872
Hi, OK you're solving my initial question so get the points thank you!

It seems that when I create a new document based upon this template inside a .NET project the Word Macro security level is automatically disabling any code so I shall have to ask how to solve that!

Thanks though.
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question