View Single Post
 
Old 05-01-2014, 05:32 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,370
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

Quote:
Originally Posted by alshcover View Post
The document has a bookmark titled "Name". The value for cboName is inserted at this bookmark.

The document has another bookmark titled "ID". I would like the StrOut variable for its associated cboName value to be inserted at this bookmark.

With your help, I've put together the code below. Is this the correct use of the StrOut variables and the Call UpdateBookmark?
You're still not updating the "Name" bookmark for 'cboName.Value' properly:
Code:
Private Sub cmdOK_Click()
Application.ScreenUpdating = False
Dim StrOut As String
StrOut = cboName.Value
Call UpdateBookmark("Name", StrOut)
Select Case cboName.Value
  Case "Bob": StrOut = "1"
  Case "Cindy": StrOut = "2"
  Case "Peter": StrOut = "3"
  Case "Vanessa": StrOut = "4"
End Select
Call UpdateBookmark("ID", StrOut)
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote