![]() |
|
|
|
#1
|
||||
|
||||
|
No, there is no 'generic code for a mail merge with DDE function' - the code is specific to each implementation. In any event, I don't see why you'd want to use DDE.
All we need is files containing sufficient material to see how each relates to the others. We don't need anything sensitive.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#2
|
|||
|
|||
|
Paul,
I believe I've overcomplicated my question in my initial post, plus, I had a bunch of additional questions that have since been solved. All the Excel Workbook's VBA code needs to do is run a (DDE format) mail merge to the document it has just created. Unfortunately, the workbook & documents themselves are not under my ownership and I cannot release even a part of them. I've attached some basic examples of what the workbook looks like, and a basic word document with some Merge fields attached that come from the Mail Merge Workbook. Please, let me know if you have any additional questions and I just wanted to say thanks again for your time & advice along the way. -Rich |
|
#3
|
|||
|
|||
|
Code:
Sub CopyandRename()
Dim str1 As String
str1 = "Q:\IC\New Structure\IC Toolkit\Templates\01 Plan Doc Template\16 Source\IC Plan Doc Template v1.0.docx"
PlanDocTemplate = Application.ActiveWorkbook.Path & "\" & Range("A1").Value & ".docx"
Call FileCopy(str1, PlanDocTemplate)
strWorkbookName = ThisWorkbook.Path & "\" & ThisWorkbook.Name
Worksheets("Data").Activate
'Opens New Plan Doc Template
Set appWD = CreateObject("Word.Application")
appWD.Visible = True
appWD.Documents.Open Filename:=PlanDocTemplate
ActiveDocument.MailMerge.OpenDataSource Name:=strWorkbookName, _
Format:=wdMergeInfoFromExcelDDE, _
ConfirmConversions:=True, _
ReadOnly:=False, _
LinkToSource:=True, _
AddtoRecentFiles:=False, _
PasswordDocument:="", _
PasswordTemplate:="", _
Revert:=False, _
Connection:="Entire Spreadsheet", _
SQLStatement:="SELECT * FROM `Data$`", _
SQLStatement1:="", _
SubType:=wdMergeSubTypeOther
End Sub
|
|
| Tags |
| excel vba, mail merge, word vba |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Create PDF | Anitha | Word | 5 | 02-01-2018 11:13 PM |
How to create this?
|
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 |
Mail merge from excel - need to create sheets and create a table
|
bluenosebex | Mail Merge | 5 | 08-02-2015 05:34 PM |
create a datafile
|
acki | Excel | 1 | 01-26-2012 07:49 AM |