Solved

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

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

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 49

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
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.

929 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

20 Experts available now in Live!

Get 1:1 Help Now