Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 03-11-2016, 02:40 PM
macropod's Avatar
macropod macropod is offline Spell out a number without protecting a document Windows 7 64bit Spell out a number without protecting a document Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

If you title the content control into which you input the number 'NumVal' and a Rich Text content control titled 'NumText' for the words, you could use a content control on exit macro like:
Code:
Private Sub Document_ContentControlOnExit(ByVal CCtrl As ContentControl, Cancel As Boolean)
Dim StrNum As String
With CCtrl
  StrNum = Trim(.Range.Text)
  If IsNumeric(StrNum) Then
  If .Title = "NumVal" Then
    With ActiveDocument
      .Fields.Add Range:=.SelectContentControlsByTitle("NumText")(1).Range, _
        Type:=wdFieldEmpty, Text:="=" & StrNum & " \* CardText", PreserveFormatting:=False
      .SelectContentControlsByTitle("NumText")(1).Range.Fields.Unlink
    End With
  End If
  End If
End With
End Sub
no protection required.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Tags
content control, vba, word 2010

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Protecting document brucemc777 Word 2 01-23-2016 02:38 PM
Spell out a number without protecting a document Protecting a document; allow sections to be edited - spacing in table cells when protected dwciardi Word 3 09-30-2015 01:03 PM
Spell out a number without protecting a document Cant type into content controls in a form after protecting document using macro rgburridge Word VBA 4 01-27-2015 02:37 PM
Disabling content controls and protecting document sections. Catty Word VBA 2 11-29-2013 05:10 AM
Protecting Word Document by restricting access permissions! user Word 0 11-20-2008 01:21 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:06 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft