![]() |
|
#1
|
|||
|
|||
![]()
Forgive me for not using the appropriate terminology. Anytime I mentioned "template", I was referring to a literal template, not a Word Template. Each of these documents are templates from a literal standpoint that are copied and pasted to create specific documents.
More specifically and with better labeling, my library consists of: 1 Word Document ("Source") that is entirely composed of Bookmarks with Mail Merge Fields. This file is typically not opened unless the specific bookmarked fields need to be changed. 1 Word Document ("Plan Doc") that is composed entirely of INCLUDETEXT fields that pull in the bookmarked sections of the Source Document depending on the user's choices within "Excel Doc". 1 Excel Document ("Excel Doc") that is used to dictate which sections go from the Source doc to the Plan doc based on fields filled out that go into Source through a Mail Merge. The current process: user copies a Plan Doc and Excel Doc and places into desired folder. Fills out the Excel Doc then runs a mail merge through the Plan Doc which uses the INCLUDETEXT fields to pull from Source Doc. Then manually has to CTRL + SHIFT + F9 to turn INCLUDETEXT fields into regular text. I want to simplify the existing process. Future process: User copies and pastes Excel Doc into desired folder. Fills out Excel doc and runs VBA command that automatically copies the Plan Doc, pastes it into whichever folder the (copied) Excel Doc exists in, runs the mail merge with DDE (or OLE DB as you suggested, whichever works, DDE works for me at the moment) and then CTRL + SHIFT + F9 the entire document to eliminate INCLUDETEXT fields and create a doc with workable text all from Excel. I hope this clarifies my request before. Thanks again for your time. |
#2
|
||||
|
||||
![]() Quote:
Quote:
Excel workbooks are neither documents nor templates. If you expect anyone else to understand what you're doing, you might at least use the right terminology. As for: Quote:
Perhaps you could attach the actual files to a post with some representative content (delete anything sensitive).
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
Paul,
Template: "a preset format for a document or file, used so that the format does not have to be recreated each time it is used." Seems like I'm using templates. "Excel Doc": Excel "Workbook", my apologies. "Source": "Source" is simply a label and I think you're being a bit overly critical. With that being said, I want to clarify that I do appreciate your feedback and remind you that I am no expert in this field which could be why my terminology and/or explanation is off. I would love to attach the files, but they're not on hand at the moment. Thanks, Paul, Rich |
#4
|
|||
|
|||
![]()
Paul,
I've managed to scrape together code that copies/renames the Plan Word Document and pastes within the same folder as the Excel Workbook. Now I just need to figure out how to run a Mail Merge on the newly created copy of Plan Word Document. Code:
Sub CopyandRename() Dim str1 As String Dim str2 As String str1 = "Q:\IC\New Structure\IC Toolkit\Templates\01 Plan Doc Template\16 Source\IC Plan Doc Template v1.0.docx" str2 = Application.ActiveWorkbook.Path & "\" & Range("A1").Value & ".docx" Call FileCopy(str1, str2) 'Opens New Plan Doc Template Set appWd = CreateObject("Word.Application") appWd.Visible = True appWd.Documents.Open Filename:=Application.ActiveWorkbook.Path & "\" & Worksheets("Form").Range("A1").Value & ".docx" End Sub Again, your assistance is greatly appreciated, Rich |
![]() |
Tags |
excel vba, mail merge, word vba |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Create PDF | Anitha | Word | 5 | 02-01-2018 11:13 PM |
![]() |
Jil.10 | Word | 4 | 05-09-2016 11:56 AM |
how to create a special template to create a clear lay out for plain text | hex | Word | 1 | 04-01-2016 09:58 AM |
![]() |
bluenosebex | Mail Merge | 5 | 08-02-2015 05:34 PM |
![]() |
acki | Excel | 1 | 01-26-2012 07:49 AM |