Solved

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

Posted on 2014-09-03
4
284 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …

688 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