Thread: [Solved] Is this possible to create?
View Single Post
 
Old 04-18-2018, 09:52 AM
RMerckling RMerckling is offline Windows 7 64bit Office 2010 32bit
Novice
 
Join Date: Jan 2018
Posts: 29
RMerckling is on a distinguished road
Default

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
All data is contained in "Data" worksheet within the Excel Workbook, and only one single Mail Merge needs to be ran using DDE, preferably.

Again, your assistance is greatly appreciated,
Rich
Reply With Quote