View Single Post
 
Old 01-16-2024, 01:39 PM
WordVB WordVB is offline Windows 11 Office 2016
Novice
 
Join Date: Jan 2024
Location: Ireland
Posts: 12
WordVB is on a distinguished road
Default

I think I managed to get it, however I can spot a potential issue. This macro enabled document will be uploaded and integrated into document storage and processing software (CCH accounts production and file management) for other users to use. The code has a reference to my local machine C drive... I will test it out tomorrow and see what pans out, but all looks great now.

Code:
Select Case aCC.Title
   Case "Title"
 If aCC.Type = wdContentControlCheckBox Then
    sTag = aCC.Tag
    Set aCC2 = ActiveDocument.SelectContentControlsByTitle("Title1")(1)
    With aCC2
      If aCC.Checked Then
      Application.Templates( _
        "C:\Users\XXXXXXXX\AppData\Roaming\Microsoft\Templates\Normal.dotm"). _
        BuildingBlockEntries("FINANCE").Insert Where:=aCC2.Range, RichText:=True
      Else
        aCC2.SetPlaceholderText Text:="Blank"
        aCC2.Range.Text = ""
      End If
    End With
  End If
End Select
Reply With Quote