Solved

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

Posted on 2014-09-03
4
274 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
  • 2
  • 2
4 Comments
 
LVL 48

Expert Comment

by:Rgonzo1971
Comment Utility
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
Comment Utility
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 48

Accepted Solution

by:
Rgonzo1971 earned 500 total points
Comment Utility
pls try

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

Author Comment

by:milesryoung
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.
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 …

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now