LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default Mail Merge from Excel

I have to recurrently send a workbook to users whom will manipulate the data
in the file and then will run a macro to create a Mail Merge (they have
different versions of Word) based on a template.

I 'm facing some questions:

How can I distribute the word file making sure that I can capture each
user's path in the MailMerge template (the DataSouce file) ?

I'm created a reference to Word 9 wich works fine but doesn't with Word 12,
how can I over come this?

Sub MailMerge()
Dim wdApp As Object
Dim wdDoc As Object
Set wdApp = CreateObject("Word.application")

Set wdDoc = wdApp.Documents.Open(Filename:="C:\Documents\name. dot")


With wdApp
.Visible = True
.ActiveWindow.WindowState = 0
.Activate
End With



With wdDoc.MailMerge
.Destination = wdSendToNewDocument
.MailAsAttachment = False
.MailAddressFieldName = ""
.MailSubject = ""
.SuppressBlankLines = True
With .DataSource
.FirstRecord = 2 'wdDefaultFirstRecord
.LastRecord = wdDoc.MailMerge.DataSource.RecordCount
'wdDefaultLastRecord
End With
.Execute Pause:=True
End With

wdDoc.Close savechanges:=False
Set wdDoc = Nothing
wdApp.Quit
Set wdApp = Nothing
End Sub



Thanks in advance


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
merge two excel files like in word mail merge azmerritt Excel Discussion (Misc queries) 1 December 11th 16 09:23 PM
How do I do an e-mail mail merge using an Excel spreadsheet? Gretchen Excel Worksheet Functions 0 July 19th 09 05:18 PM
Mail merge macro: select recipients from Excel during merge Worksmart Excel Programming 0 May 18th 08 06:37 PM
Code launches Mail Merge but disables the Mail Merge austris Excel Discussion (Misc queries) 0 October 14th 06 01:11 AM
Can I merge an excel list to an excel sheet like mail merge in wor chcoach Excel Programming 0 March 7th 06 07:09 PM


All times are GMT +1. The time now is 08:41 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"