Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #16  
Old 06-23-2014, 11:10 PM
toughiv toughiv is offline Mail Merging - Mergeseq + Send Via Email Merge Windows Vista Mail Merging - Mergeseq + Send Via Email Merge Office 2010 32bit
Novice
Mail Merging - Mergeseq + Send Via Email Merge
 
Join Date: Jun 2014
Posts: 21
toughiv is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Have you checked the contents of the 'EmailDataSource.doc' file to see what your directory merge generated? If you set up the Key field in your Catalog/Directory mailmerge main document to use the email addresses as the key, that would result in only one email being sent.

You only need to follow the instructions. There is nothing extra (or less) that you need to do.
The email data source looks as if the table join macro which is part of the runmerge macro doesn't complete.


The data source is a bunch of one line tables that have "]" Seperating them.
I have made sure there are no extra paragraph marks. The key field is set as company name. Instead of "recipient" I have the email address merge field.
I have tried running the macro with the tutorial files, using the tutorial data source. It results in the same one row tables separated by "]".

I will be at my work computer in an hour. I will upload a sample if you wouldn't mind? Im so close I can't almost taste it!

Thanks
Reply With Quote
  #17  
Old 06-23-2014, 11:14 PM
macropod's Avatar
macropod macropod is offline Mail Merging - Mergeseq + Send Via Email Merge Windows 7 32bit Mail Merging - Mergeseq + Send Via Email Merge Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

Quote:
Originally Posted by toughiv View Post
The data source is a bunch of one line tables that have "]" Seperating them.
What that means is that you have copied the ']' character that follows the field into the mailmerge main document! You should only have the field, not the '[' or ']' either side of it...
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #18  
Old 06-23-2014, 11:35 PM
toughiv toughiv is offline Mail Merging - Mergeseq + Send Via Email Merge Windows Vista Mail Merging - Mergeseq + Send Via Email Merge Office 2010 32bit
Novice
Mail Merging - Mergeseq + Send Via Email Merge
 
Join Date: Jun 2014
Posts: 21
toughiv is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
What that means is that you have copied the ']' character that follows the field into the mailmerge main document! You should only have the field, not the '[' or ']' either side of it...
I guessed as much - but reading the tutorial, thought I was supposed to. I will delete those and double check. No doubt it won't be as easy a fix as that- it never is haha. But I'm hoping!!!

Thanks macro
Reply With Quote
  #19  
Old 06-23-2014, 11:45 PM
macropod's Avatar
macropod macropod is offline Mail Merging - Mergeseq + Send Via Email Merge Windows 7 32bit Mail Merging - Mergeseq + Send Via Email Merge Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

Quote:
Originally Posted by toughiv View Post
I guessed as much - but reading the tutorial, thought I was supposed to.
I've never encountered anyone with that interpretation before! After all, as the tutorial says in the Introduction, on page #1:
Quote:
For ease of identification, the fields used in the various examples are encompassed by square brackets (ie ‘[ ]’).
Similarly, on page #25, for the email merge it says:
Quote:
set up a separate Catalog/Directory mailmerge main document, with a single paragraph containing field coding like:
[
«City» «Representative» «Sales»
]
Note: Your Catalog/Directory mailmerge main document shouldn’t have anything else – not even an extra empty paragraph; otherwise you may not get the expected results.
I'd have thought it pretty obvious from those two statements taken together that you don't copy either square bracket. And, if you thought you were meant to copy one, why not both?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #20  
Old 06-24-2014, 12:43 AM
toughiv toughiv is offline Mail Merging - Mergeseq + Send Via Email Merge Windows Vista Mail Merging - Mergeseq + Send Via Email Merge Office 2010 32bit
Novice
Mail Merging - Mergeseq + Send Via Email Merge
 
Join Date: Jun 2014
Posts: 21
toughiv is on a distinguished road
Default

The problem being - i skimmed all the way until page 25...

I then just saw the bit about copy this and make sure you have no extra paragraph marks. With both statements - you are correct. Its very obvious.

I did remove the "]" now. And it seems to be working! Hurrah! ... slight and now is only a slight problem.

I have attached a jpeg of the error message.

I think it could be where the recipient is within the quotation marks.

Therefore, I have attached a screenshot of the coding & the email main merge document template I use.

Is it because I have recipient in the table of the directory?

**P.s. - when it sends the email it is all in plain text. - what line would i use where it says "plaintext" in the macro?

Also - there is no gap between the "with yourselves are:..." & then the table. Is that because it is plain text?

Thanks!!!
Attached Images
File Type: jpg MM_Template.jpg (41.7 KB, 29 views)
File Type: jpg ErrorMsg_MMerge.jpg (44.7 KB, 29 views)
File Type: jpg MMerge_Coding.jpg (61.9 KB, 29 views)
Reply With Quote
  #21  
Old 06-24-2014, 01:07 AM
macropod's Avatar
macropod macropod is offline Mail Merging - Mergeseq + Send Via Email Merge Windows 7 32bit Mail Merging - Mergeseq + Send Via Email Merge Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

The Outlook Message is probably the result of one of your Outlook settings. Perhaps the 'Automatic name checking' option under File|Options|Mail>Send messages. I don't use Outlook, so I can't be sure which option it might be but that one look like a good place to start. I note too that your error-message screenshot shows the same email address three times. That suggests you're still trying to send three emails to the same person. That's probably because you have an email address in each record. The simplest fix is to have the email address in only the first record for each group; otherwise some additional field coding would be required to eliminate duplicates (I don't have time for that right now - studying for a Uni exam).

The spacing between the "with yourselves are:..." and the table can probably be handled by inserting a couple of line breaks/paragraph breaks between them in the source file.

To send the emails in HTML format, you'd change:
.MailFormat = wdMailFormatPlainText
to:
.MailFormat = wdMailFormatHTML
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #22  
Old 06-24-2014, 01:14 AM
toughiv toughiv is offline Mail Merging - Mergeseq + Send Via Email Merge Windows Vista Mail Merging - Mergeseq + Send Via Email Merge Office 2010 32bit
Novice
Mail Merging - Mergeseq + Send Via Email Merge
 
Join Date: Jun 2014
Posts: 21
toughiv is on a distinguished road
Default

thank you macro.

Btw! You are a legend. I got the merge working!

One little thing - an issue with alignment now. While i get all the records grouped and merged...for some reason a couple of the lines a few rows down...seem to be on a different margin / begin further toward the middle of the page.

The excel spreadsheet has all of the cells aligned the same.

Do you have an idea what might be causing this? Im gonna have a mess around and try figure it out myself

Thanks
Reply With Quote
  #23  
Old 06-24-2014, 02:29 AM
macropod's Avatar
macropod macropod is offline Mail Merging - Mergeseq + Send Via Email Merge Windows 7 32bit Mail Merging - Mergeseq + Send Via Email Merge Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

Quote:
Originally Posted by toughiv View Post
One little thing - an issue with alignment now. While i get all the records grouped and merged...for some reason a couple of the lines a few rows down...seem to be on a different margin / begin further toward the middle of the page.

The excel spreadsheet has all of the cells aligned the same.
The alignment in any mailmerge is entirely independent of any alignment in the data source - in this case it's all controlled by the second document's formatting, including parapraph and tab alignments. The differences you're seeing are probably due to some inconsistencies in the paragraph formatting of that document.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #24  
Old 06-24-2014, 06:53 AM
toughiv toughiv is offline Mail Merging - Mergeseq + Send Via Email Merge Windows Vista Mail Merging - Mergeseq + Send Via Email Merge Office 2010 32bit
Novice
Mail Merging - Mergeseq + Send Via Email Merge
 
Join Date: Jun 2014
Posts: 21
toughiv is on a distinguished road
Default

Is there a way I should write emails into a cell if there are more than one for the company?

I assumed it would be: email1@nowhere.com;email2@nowhere.com.

It doesnt work though? Is that a limitation?

Thanks
Reply With Quote
  #25  
Old 06-24-2014, 07:41 PM
macropod's Avatar
macropod macropod is offline Mail Merging - Mergeseq + Send Via Email Merge Windows 7 32bit Mail Merging - Mergeseq + Send Via Email Merge Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

I'd have thought: email1@nowhere.com; email2@nowhere.com (i.e. with a space after the semi-colon). An alternative might be to create group in Outlook, then use the group name in the mailmerge.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #26  
Old 06-27-2014, 11:06 AM
toughiv toughiv is offline Mail Merging - Mergeseq + Send Via Email Merge Windows Vista Mail Merging - Mergeseq + Send Via Email Merge Office 2010 32bit
Novice
Mail Merging - Mergeseq + Send Via Email Merge
 
Join Date: Jun 2014
Posts: 21
toughiv is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Have you checked the contents of the 'EmailDataSource.doc' file to see what your directory merge generated? If you set up the Key field in your Catalog/Directory mailmerge main document to use the email addresses as the key, that would result in only one email being sent.

You only need to follow the instructions. There is nothing extra (or less) that you need to do.
Macro ... I need your help again xD
I'll admit straight off the bat- I have replaced a merge field as I was trying to send a different directory from a different excel worksheet.
The worksheet itself was pretty much the same, maybe a few extra columns, but the data itself from the same program.
For some weird reason - the table joiner is working but in an odd fashion.
When I look at the data source, the tables are merged, but the first row becomes merged in its own table, then the subsequent rows ( say 20) get merged into a different box below the first row.
The results in only the first row of data being merged and sent.
I looked at the code - no extra paragraphs, no [] markers like previously.

Any ideas?

Thanks mac
Reply With Quote
  #27  
Old 06-27-2014, 11:20 PM
macropod's Avatar
macropod macropod is offline Mail Merging - Mergeseq + Send Via Email Merge Windows 7 32bit Mail Merging - Mergeseq + Send Via Email Merge Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

Without seeing the problem document and the mailmerge document it was created from, it would be difficult for anyone to diagnose the issue. Can you attach a document to a post with some representative data (delete anything sensitive)? You do this via the paperclip symbol on the 'Go Advanced' tab at the bottom of this screen.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #28  
Old 06-30-2014, 12:52 AM
toughiv toughiv is offline Mail Merging - Mergeseq + Send Via Email Merge Windows Vista Mail Merging - Mergeseq + Send Via Email Merge Office 2010 32bit
Novice
Mail Merging - Mergeseq + Send Via Email Merge
 
Join Date: Jun 2014
Posts: 21
toughiv is on a distinguished road
Default

I have attached the files.

Thanks for having a look at this Macro.
Attached Files
File Type: xlsx trial.xlsx (11.8 KB, 13 views)
File Type: doc Coding.doc (29.0 KB, 17 views)
Reply With Quote
  #29  
Old 06-30-2014, 01:04 AM
macropod's Avatar
macropod macropod is offline Mail Merging - Mergeseq + Send Via Email Merge Windows 7 32bit Mail Merging - Mergeseq + Send Via Email Merge Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

Your attachments look OK, but the 'Coding.doc' isn't saved as a mailmerge main document and you didn't attach the problem output document generated by the merge (i.e. the 'Email Merge Main Document' file).
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #30  
Old 06-30-2014, 01:22 AM
toughiv toughiv is offline Mail Merging - Mergeseq + Send Via Email Merge Windows Vista Mail Merging - Mergeseq + Send Via Email Merge Office 2010 32bit
Novice
Mail Merging - Mergeseq + Send Via Email Merge
 
Join Date: Jun 2014
Posts: 21
toughiv is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Your attachments look OK, but the 'Coding.doc' isn't saved as a mailmerge main document and you didn't attach the problem output document generated by the merge (i.e. the 'Email Merge Main Document' file).
It wouldnt allow me to attach the relevant version of the document - It kept saying invalid.

I have attached the coding I used from the tutorial doc.

Since Im having difficulty attaching, could you not start a new word doc, start directory merge - copy and paste the code across and then paste this code into the developer:

Code:
Sub RunMerge()
Application.ScreenUpdating = False
Dim Doc1 As Document, Doc2 As Document, Doc3 As Document, StrDoc As String
Set Doc1 = ThisDocument
StrDoc = ThisDocument.Path & "\EmailDataSource.doc"
If Dir(StrDoc) <> "" Then Kill StrDoc
With Doc1.MailMerge
  If .State = wdMainAndDataSource Then
    .Destination = wdSendToNewDocument
    .Execute
    Set Doc2 = ActiveDocument
  End If
End With
Call EmailMergeTableMaker(Doc2)
With Doc2
  .SaveAs FileName:=StrDoc, AddToRecentFiles:=False, FileFormat:=wdFormatDocument
  StrDoc = .FullName
  .Close
End With
Set Doc2 = Nothing
Set Doc3 = Documents.Open(FileName:=Doc1.Path & "\Email Merge Main Document.doc", _
  AddToRecentFiles:=False)
With Doc3.MailMerge
  .MainDocumentType = wdEMail
  .OpenDataSource Name:=StrDoc, ConfirmConversions:=False, ReadOnly:=False, _
    LinkToSource:=True, AddToRecentFiles:=False, Connection:="", SQLStatement:="", _
    SQLStatement1:="", SubType:=wdMergeSubTypeOther
  If .State = wdMainAndDataSource Then
    '.Destination = wdSendToNewDocument
    .Destination = wdSendToEmail
    .MailAddressFieldName = "Outstanding Invoices"
    .MailSubject = "Monthly Sales Stats"
    .MailFormat = wdMailFormatHTML
    .Execute
  End If
End With
Doc3.Close SaveChanges:=False
Set Doc3 = Nothing
Application.ScreenUpdating = True
End Sub
Sub EmailMergeTableMaker(DocName As Document)
Dim oTbl As Table, i As Integer, j As Integer, oRow As Row, oRng As Range, strTxt As String
With DocName
  .Paragraphs(1).Range.Delete
  Call TableJoiner
  For Each oTbl In .Tables
  j = 2
    With oTbl
      i = .Columns.Count - j
      For Each oRow In .Rows
        Set oRng = oRow.Cells(j).Range
        With oRng
          .MoveEnd Unit:=wdCell, Count:=i
          .Cells.Merge
          strTxt = Replace(.Text, vbCr, vbTab)
          On Error Resume Next
          If Len(strTxt) > 1 Then .Text = Left(strTxt, Len(strTxt) - 2)
        End With
      Next
    End With
  Next
  For Each oTbl In .Tables
    For i = 1 to j
      oTbl.Columns(i).Cells.Merge
    Next
  Next
  With .Tables(1)
    .Rows.Add BeforeRow:=.Rows(1)
    .Cell(1, 1).Range.Text = "Recipient"
    .Cell(1, 2).Range.Text = "Data"
  End With
  .Paragraphs(1).Range.Delete
  Call TableJoiner
End With
Set oRng = Nothing
End Sub
Private Sub TableJoiner()
Dim oTbl As Table
For Each oTbl In ActiveDocument.Tables
  With oTbl.Range.Next
    If .Information(wdWithInTable) = False Then .Delete
  End With
Next
End Sub
I hope that isnt too much trouble?

Thanks!
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail Merging - Mergeseq + Send Via Email Merge mail merge in excel to send pdf forms heyullama Excel 7 12-01-2013 03:32 PM
Mail Merge Many URLs in one email by common email address instantaphex Mail Merge 3 04-29-2013 05:46 PM
Mail Merge to email, changing images on email layout ginelli Mail Merge 18 02-23-2013 09:47 AM
Mail Merging - Mergeseq + Send Via Email Merge Mail Merge with Booklets is Merging all documents into One stapled Booklet 15Degrees Mail Merge 1 01-31-2013 02:06 AM
Send e-mail message in Finish & Merge CDTom Mail Merge 1 08-24-2012 12:52 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:37 PM.


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