Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #11  
Old 11-15-2012, 11:25 PM
macropod's Avatar
macropod macropod is offline How do i insert autotext using a contol toolbox checkbox Windows 7 64bit How do i insert autotext using a contol toolbox checkbox Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,536
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

Try:
Code:
Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then
  Call UpdateBookmark("Destination", "Subdivision")
Else
  Call UpdateBookmark("Destination", "")
End If
End Sub
 
Sub UpdateBookmark(BmkNm As String, NewTxt As String)
Dim BmkRng As Range
With ActiveDocument
  If .Bookmarks.Exists(BmkNm) Then
    Set BmkRng = .Bookmarks(BmkNm).Range
    BmkRng.Text = NewTxt
    .Bookmarks.Add BmkNm, BmkRng
    If BmkRng.Text = "Subdivision" Then BmkRng.InsertAutoText
  End If
End With
Set BmkRng = Nothing
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do i insert autotext using a contol toolbox checkbox Autotext jafrapatty Word 2 05-09-2014 04:30 AM
How do i insert autotext using a contol toolbox checkbox Word 2003 Document Opens In control toolbox Edit Mode rangasamy007 Word 1 09-16-2011 04:12 AM
AutoText question harbor11 Word 0 12-16-2009 09:42 AM
Control Toolbox tjc154 Word 0 03-29-2009 07:13 PM
Excel ->VB code for Checkbox (control toolbox) kirkstyle Excel 0 08-16-2006 04:17 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:09 PM.


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