Solved

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

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel Type grid in Publisher 1 37
Capture logon name 13 70
Excel Hyperlink Question 4 48
One Drive Login/Configuration Issue 12 38
Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
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…
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 …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

813 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

15 Experts available now in Live!

Get 1:1 Help Now