Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
dave dave is offline
external usenet poster
 
Posts: 4
Default Mailmerge in a macro

I have a mail merge that works very nicely, but when I try to run it
from a macro it errors out on the " .Destination =
wdSendToNewDocument" line telling me the "requested object is not
available". Any ideas? Thanks.

Documents.Open FileName:="""Policy projection main.doc""", _
ConfirmConversions:=False, ReadOnly:=False,
AddToRecentFiles:=False, _
PasswordDocument:="", PasswordTemplate:="", Revert:=False, _
WritePasswordDocument:="", WritePasswordTemplate:="", Format:=
_
wdOpenFormatAuto, XMLTransform:=""
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.SuppressBlankLines = True
With .DataSource
.FirstRecord =
ActiveDocument.MailMerge.DataSource.ActiveRecord
.LastRecord =
ActiveDocument.MailMerge.DataSource.ActiveRecord
End With
.Execute Pause:=False
End With

  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Mailmerge in a macro

You probably need to do the registry fix described in

http://support.microsoft.com/kb/825765

Peter Jamieson

"dave" wrote in message
oups.com...
I have a mail merge that works very nicely, but when I try to run it
from a macro it errors out on the " .Destination =
wdSendToNewDocument" line telling me the "requested object is not
available". Any ideas? Thanks.

Documents.Open FileName:="""Policy projection main.doc""", _
ConfirmConversions:=False, ReadOnly:=False,
AddToRecentFiles:=False, _
PasswordDocument:="", PasswordTemplate:="", Revert:=False, _
WritePasswordDocument:="", WritePasswordTemplate:="", Format:=
_
wdOpenFormatAuto, XMLTransform:=""
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.SuppressBlankLines = True
With .DataSource
.FirstRecord =
ActiveDocument.MailMerge.DataSource.ActiveRecord
.LastRecord =
ActiveDocument.MailMerge.DataSource.ActiveRecord
End With
.Execute Pause:=False
End With


  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
dave dave is offline
external usenet poster
 
Posts: 4
Default Mailmerge in a macro

yes. that worked. thank you.


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mailmerge and Macro uriahheep Mailmerge 1 December 7th 06 03:56 PM
MailMerge Macro HELP Dirdata via OfficeKB.com Microsoft Word Help 1 October 6th 06 11:14 AM
Macro execution using MailMerge nelsonj Mailmerge 9 June 13th 06 05:04 PM
Word mailmerge to PDF macro Martin Mailmerge 2 April 13th 06 06:31 AM
Mailmerge by macro J.Reynolds Mailmerge 5 June 17th 05 09:36 PM


All times are GMT +1. The time now is 11:20 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"