S
SuzyQ
I am setting up a user form for an employment contract. Amongst other
information the user needs to include will be the address block for the
relevant office that the person is being employed through. I have each
address block set up as auto text.
I have set up the code to insert the value at a specific bookmark however I
can't work out how to get it to insert a particular auto text at the bookmark
i.e if the combo value equaled Sydney it would insert the auto text "atxtsyd"
This is my code
Private Sub cmd_ok_Click()
Dim addressRange As Range
With ActiveDocument
If .Bookmarks.Exists("TestAddress") Then
Set addressRange = .Bookmarks("TestAddress").Range
Else
Set addressRange = Selection.Range
End If
addressRange.Text = cbotest.Value
***can you define what value it should equal at this point****
.Bookmarks.Add Name:="TestAddress", Range:=addressRange
End With
Me.Hide
End Sub
Thank you.
Susan
information the user needs to include will be the address block for the
relevant office that the person is being employed through. I have each
address block set up as auto text.
I have set up the code to insert the value at a specific bookmark however I
can't work out how to get it to insert a particular auto text at the bookmark
i.e if the combo value equaled Sydney it would insert the auto text "atxtsyd"
This is my code
Private Sub cmd_ok_Click()
Dim addressRange As Range
With ActiveDocument
If .Bookmarks.Exists("TestAddress") Then
Set addressRange = .Bookmarks("TestAddress").Range
Else
Set addressRange = Selection.Range
End If
addressRange.Text = cbotest.Value
***can you define what value it should equal at this point****
.Bookmarks.Add Name:="TestAddress", Range:=addressRange
End With
Me.Hide
End Sub
Thank you.
Susan