Results 1 to 2 of 2

Stuck with VBA Code when Mail Merging from Excel (Data Source DDE)

Threaded View

  1. #1
    Registered User
    Join Date
    08-27-2012
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    1

    Lightbulb Stuck with VBA Code when Mail Merging from Excel (Data Source DDE)

    Hi All,

    I've found myself stuck with writing code to Mail Merge information from excel to a word document. The VBA manages to open the Word document but fails to excute the process when opening the Source Data (DDE).

    Can anyone help me???


    Set wordapp = GetObject(, "Word.Application")
    Set worddoc = wordapp.Documents.Open("\Word Document Location")
    wordapp.Visible = True
    
    With worddoc.MailMerge
    .MainDocumentType = wdFormLetters
    .OpenDataSource _
            Name:= _
            "Excel Docum", _
            ConfirmConversions:=True, ReadOnly:=False, LinkToSource:=True, _
            AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
            WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
            Format:=wdOpenFormatAuto, Connection:="Entire Spreadsheet", SQLStatement _
            :="", SQLStatement1:="", SubType:=wdMergeSubTypeOther
    worddoc.MailMerge.ViewMailMergeFieldCodes = wdToggle
    
    End With

    Thanks
    Last edited by arlu1201; 08-27-2012 at 08:10 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1