View Single Post
 
Old 03-16-2015, 05:41 AM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Code:
Private Sub UserForm_Initialize()
  With cboPosition
    .AddItem "Nub"
    .AddItem "Journeyman"
    .AddItem "Engineer"
  End With
End Sub
Private Sub cmdOK_Click()
  If cboPosition.Value = "Engineer" Then
    WriteToBM "Grade", "E"
  End If
  Hide
End Sub
Sub WriteToBM(strName As String, strText As String)
Dim oRng As Word.Range
  Set oRng = ActiveDocument.Bookmarks(strName).Range
  oRng.Text = strText
  ActiveDocument.Bookmarks.Add strName, oRng
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote