Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-20-2018, 04:13 PM
macropod's Avatar
macropod macropod is offline Is this possible to create? Windows 7 64bit Is this possible to create? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,342
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default


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]
Reply With Quote
  #2  
Old 04-23-2018, 08:13 AM
RMerckling RMerckling is offline Is this possible to create? Windows 7 64bit Is this possible to create? Office 2010 32bit
Novice
Is this possible to create?
 
Join Date: Jan 2018
Posts: 29
RMerckling is on a distinguished road
Default

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
Attached Files
File Type: docx Plan Doc Template.docx (12.5 KB, 10 views)
File Type: xlsm MailMergeExample.xlsm (17.0 KB, 10 views)
Reply With Quote
  #3  
Old 04-27-2018, 01:18 PM
RMerckling RMerckling is offline Is this possible to create? Windows 7 64bit Is this possible to create? Office 2010 32bit
Novice
Is this possible to create?
 
Join Date: Jan 2018
Posts: 29
RMerckling is on a distinguished road
Default Figured it out.

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
Reply With Quote
Reply

Tags
excel vba, mail merge, word vba



Similar Threads
Thread Thread Starter Forum Replies Last Post
Create PDF Anitha Word 5 02-01-2018 11:13 PM
Is this possible to create? 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
Is this possible to create? Mail merge from excel - need to create sheets and create a table bluenosebex Mail Merge 5 08-02-2015 05:34 PM
Is this possible to create? create a datafile acki Excel 1 01-26-2012 07:49 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:04 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft