Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / May 2006

Tip: Looking for answers? Try searching our database.

Mail Merge - Code to complete merge

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Craig Ferrier - 29 Apr 2006 18:50 GMT
I use an Access database and modules to prepare a mail merge.

It opens word and shows the document with the field codes and doesn't
actually finish the merge (purposely).  When the word document opens I would
like it to show the results of the merge data and then create a text box
with "are you ready to finish the merge" Y/N option, and then complete the
merge.

How can this be done.

Craig
Jezebel - 30 Apr 2006 02:16 GMT
Can't be done as you describe. What's the purpose of the exercise?

>I use an Access database and modules to prepare a mail merge.
>
[quoted text clipped - 7 lines]
>
> Craig
Craig Ferrier - 30 Apr 2006 05:43 GMT
Purpose:  the mail merge has been set up as an email merge.  I want to view
the document before it sends it.

Craig

> Can't be done as you describe. What's the purpose of the exercise?
>
[quoted text clipped - 9 lines]
>>
>> Craig
Doug Robbins - Word MVP - 30 Apr 2006 07:40 GMT
Show us your code.

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Purpose:  the mail merge has been set up as an email merge.  I want to
> view
[quoted text clipped - 15 lines]
>>>
>>> Craig
Craig - 01 May 2006 22:25 GMT
Code is as follows:  I am using a word merge that was created by someone
else but editing it to perform differently.

If strActiveDoc = "Invoice.doc" Then

     WordDoc.MailMerge.OpenDataSource _
       Name:=strDataDir & TextMerge, _
       ConfirmConversions:=False, _
       ReadOnly:=False, LinkToSource:=True, AddToRecentFiles:=False, _
       PasswordDocument:="", PasswordTemplate:="",
WritePasswordDocument:="", _
       WritePasswordTemplate:="", Revert:=False, Format:=0, _
       Connection:="", SQLStatement:="", SQLStatement1:=""

   With WordDoc.MailMerge
   .ReadOnly = True
     .Destination = 2        ' 0 = new doc 2=email
     .MailAsAttachment = False
     .MailAddressFieldName = "AdEmail"
     .MailSubject = "Invoice " &
Forms!frmAdvertisers!subfrmAdvertisements!AdvertisementID
     .SuppressBlankLines = True
     With .datasource
        .FirstRecord = 1
            .LastRecord = 1
     End With
     '.Execute Pause:=False  (This line i noted which seems to stop the
mail merge from executing)
  End With

  'WordDoc.Close (False)

  wordApp.Visible = True
  wordApp.Windows(wordApp.Windows.Count).Activate
  If strOutDocName <> "" Then
    wordApp.ActiveDocument.SaveAs strOutDocName
  End If

  AppActivate "Microsoft Word"
  wordApp.Activate
  wordApp.WindowState = 1

Thanks
Craig

> Show us your code.
>
[quoted text clipped - 17 lines]
>>>>
>>>> Craig
Craig - 01 May 2006 23:20 GMT
I have found one part of the solution

  WordDoc.MailMerge.ViewMailMergeFieldCodes = 0  (this switches from field
view to data view)  -1 (field)

Craig

> Show us your code.
>
[quoted text clipped - 17 lines]
>>>>
>>>> Craig
Jezebel - 30 Apr 2006 07:55 GMT
You can use the 'Merge to new document' option (on the MailMerge toolbar) to
get a preview.

Or disable your internet connection, run the merge, and look at the results
in the Outlook Outbox. If you're happy, re-enable your connection.

> Purpose:  the mail merge has been set up as an email merge.  I want to
> view
[quoted text clipped - 15 lines]
>>>
>>> Craig
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.