View Single Post
 
Old 09-06-2023, 10:58 AM
gmaxey gmaxey is offline Windows 10 Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,601
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Something like this. Assumes your service portfolio document is in the same folder as your collection of description files and your description files are of the .docx format.


Code:
Sub ScratchMacro()
'A basic Word Macro coded by Gregory K. Maxey
Dim oRng As Range
Dim strPath As String
Dim strKeyWord As String
  Set oRng = ActiveDocument.Range
  strKeyWord = "Orange"
  With oRng.Find
    .Text = "Orange"
    If .Execute Then
      oRng.Text = vbNullString
      strPath = ThisDocument.path & "\"
      oRng.InsertFile strPath & strKeyWord & ".docx"
    End If
  End With
lbl_Exit:
  Exit Sub
  Resume
End Sub

That said, a better idea might just be to create building blocks in a global template addin and use the building blocks to define product descriptions.
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote