![]() |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
![]()
Hello,
I am looking for advice on the best approach to a challenge I have today. I have a main Word document that I would like to insert sections of other Word documents (I'll call these documents 'snippets') into, to build out a boilerplate. All documents (main & snippets) are built from the same template, so styles, etc are identical. In each of my snippet documents, the section I wish to insert is currently bounded by simple text tags {start} & {end} each on their own otherwise blank pages. If there is a better way to identify the wanted section in each snippet doc, then I am open to changing from text tags. I have some VBA working to give me a dialog box where I can select the multiple snippet documents and currently I am just outputting the full path of each file to Debug.Print. I am not sure how to process each snippet document, to locate the section between the tags, and insert it into the main doc. Code:
Sub SelectSnippetFiles() Dim mfd As FileDialog Dim FileChosen As Integer Dim i As Integer Set mfd = Application.FileDialog(msoFileDialogFilePicker) mfd.InitialView = msoFileDialogViewList mfd.AllowMultiSelect = True FileChosen = mfd.Show If FileChosen = -1 Then For i = 1 To mfd.SelectedItems.Count Debug.Print mfd.SelectedItems(i) 'I need something here to process the snippet sections :-/ Next i End If End Sub I am using Office 365, so have pretty much the latest version. Thanks M |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
MimiCush | Word | 4 | 03-26-2018 01:07 PM |
How to insert a section in the middle of a Word document, but keep the sections around it continuous | vspofford | Word | 3 | 01-30-2016 01:19 PM |
Can Word highlight the same text in the Reviewing Pane as in the main document? | wordistheword | Word | 4 | 09-09-2013 04:50 AM |
How to insert full documents into existing word document | Laraak | Word | 1 | 03-07-2013 11:59 PM |
Connecting documents to main document | themangoagent | Word | 1 | 08-07-2009 10:15 AM |