View Single Post
 
Old 11-15-2012, 09:41 PM
NP85 NP85 is offline Windows XP Office 2003
Novice
 
Join Date: Nov 2012
Posts: 6
NP85 is on a distinguished road
Default

Thanks heaps thats so awesome!!!


If instead of inserting "Nunc viverra imperdiet enim. Fusce est. Vivamus a tellus" as shown below i want to run a macro i have previously recorded (this macro automatically inserts specific tables and words and i want them to be inserted at the bookmark "destination"), is there a way of calling up the macro within that loop? (the macro names is 'AutoSubdivision')??

Code:
Option Explicit
 
Private Sub CheckBox13534191_Click()
If CheckBox13534191.Value = True Then
  Call UpdateBookmark("Destination", "Nunc viverra imperdiet enim. Fusce est. Vivamus a tellus." & vbCr)
Else
  Call UpdateBookmark("Destination", "")
End If
End Sub
 
Sub UpdateBookmark(BmkNm As String, NewTxt As String)
Dim BmkRng As Range
With ActiveDocument
  If .Bookmarks.Exists(BmkNm) Then
    Set BmkRng = .Bookmarks(BmkNm).Range
    BmkRng.Text = NewTxt
    .Bookmarks.Add BmkNm, BmkRng
  End If
End With
Set BmkRng = Nothing
End Sub

Last edited by macropod; 11-15-2012 at 10:45 PM. Reason: Added code tags & formatting
Reply With Quote