View Single Post
 
Old 07-03-2014, 10:33 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

Yes you are on the right track, but ActiveX controls are not ideal for use in Word documents.

You need a range target for the text. It could be a table cell, a paragraph, a bookmark, a content control, a variables (and use a DocVariable field), etc.

Here I have created a bookmark "bmText" to serve as the target range.

Code:
Option Explicit
Dim oBM As Bookmark
Dim oRng As Range
Private Sub OptionButton111_Click()
If Me.OptionButton111.Value = True Then
   Set oRng = ActiveDocument.Bookmarks("bmText").Range
   oRng.Text = "User will email form"
   ActiveDocument.Bookmarks.Add "bmText", oRng
End If
End Sub
 
Private Sub OptionButton211_Click()
If Me.OptionButton211.Value = True Then
  Set oRng = ActiveDocument.Bookmarks("bmText").Range
   oRng.Text = "User will mail form via FedEx"
   ActiveDocument.Bookmarks.Add "bmText", oRng
End If
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote