Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 03-18-2014, 05:05 PM
macropod's Avatar
macropod macropod is offline Word 2007 VBA Combobox Conditional text problem Windows 7 32bit Word 2007 VBA Combobox Conditional text problem 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

Do you want the new item added to the dropdown list, rejected, or just permitted and output to the bookmark?

As for the basic code to update the bookmark, try the following ContentControlOnExit macro:
Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
With ContentControl
 If .Title = "MyCtrl" Then Call UpdateBookmark("picked", .Range.Text)
End With
End Sub
 
Sub UpdateBookmark(StrBkMk As String, StrTxt As String)
Dim BkMkRng As Range
With ActiveDocument
 If .Bookmarks.Exists(StrBkMk) Then
   Set BkMkRng = .Bookmarks(StrBkMk).Range
   BkMkRng.Text = StrTxt
   .Bookmarks.Add StrBkMk, BkMkRng
 End If
End With
Set BkMkRng = Nothing
End Sub
The code assumes your Content Control has the "MyCtrl" title.

PS: When posting code, please use the code tags. They're on the 'Go Advanced' tab.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Working with Dropdown/Combobox in word 2007 lucky16 Word 0 01-26-2014 08:11 AM
Word 2007 VBA Combobox Conditional text problem Populating ComboBox or Drop Down list with contents of a text field Billy_McSkintos Word VBA 1 09-13-2011 05:50 AM
Conditional Formatting Problem Excel 2007 namedujour Excel 6 08-04-2011 10:52 AM
Word 2007 VBA Combobox Conditional text problem Array into ComboBox + Macro-Text into ActiveDocument Vivi Word VBA 1 01-27-2010 07:03 AM
Conditional Text Adding - Word 2003 chuck Mail Merge 0 06-17-2009 08:09 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:40 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