Mail merge: Template containing images with variation

Last post 11-07-2011, 9:55 AM by alexey.noskov. 3 replies.
Sort Posts: Previous Next
  •  11-04-2011, 1:15 PM 340296

    Mail merge: Template containing images with variation .NET

    Attachment: Present (inaccessible)

    Hi,

    I have a problem with my mailmerge using Aspose Word 10.5.  In my Word 2007 template, I have an image "behind the text" and this image containing a light variation (Picture format).  When I do my MailMerge, this variation is not in my final document.

    Can you help me with my problem.

    Thanks

    Steeve

     
  •  11-04-2011, 3:43 PM 340313 in reply to 340296

    Re: Mail merge: Template containing images with variation

    Hi

     

    Thanks for your request. I suppose, you are saving the output document as DOC. That is why formatting option available in Office 2007 are lost. If you save the output as DOCX, the image will look the same as in input document.

    So, if using DOCX format as output format is acceptable for you, I would suggest you to use this format.

     

    Best regards,


    Alexey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  11-07-2011, 9:02 AM 340584 in reply to 340313

    Re: Mail merge: Template containing images with variation .NET

    Attachment: Present (inaccessible)

    Hi Alexey,

    My output is in .docx.  This is my code to do the mailmerge:

    private void SaveCertificate(Certificate certificate, string sRootFolder)
    {

    Document docTmp = (Document)FinalCertificate.Clone(true);
    string sCompleteFolder = sRootFolder + "Complete\\";
    string sCompleteFileName = sCompleteFolder + certificate.CertificateEmployee.LastName + ", " + certificate.CertificateEmployee.FirstName + "_" + certificate.CertificateSession.FileCode + ".docx";

    docTmp.MailMerge.Execute(
    new string[] { "First_Name", "Last_Name", "Coursenb", "Coursetitle", "Ville", "Date", "Duration", "Trainer" },
    new object[] {
    certificate.CertificateEmployee.FirstName,
    certificate.CertificateEmployee.LastName,
    certificate.CertificateSession.Code,
    certificate.CertificateSession.Name,
    certificate.CertificateSession.Ville,
    certificate.CertificateSession.Date,
    certificate.CertificateSession.Duration,
    certificate.CertificateSession.Trainer });

    if (!Directory.Exists(sCompleteFolder))
       
    Directory.CreateDirectory(sCompleteFolder);

    docTmp.Save(sCompleteFileName, SaveFormat.Docx);
    }

    I let you in attachment my template and an example of the output

    I let you also my code to get the template (openfiledialog):

    private void btnBrowseCertificate_Click(object sender, EventArgs e)
    {
    Stream myStream;
    OpenFileDialog openFileDialog1 = new OpenFileDialog();
    openFileDialog1.InitialDirectory =
    "C:\\";
    openFileDialog1.Filter =
    "Word Document (*.doc, *.docx)|*.doc;*docx";
    openFileDialog1.FilterIndex = 1;
    openFileDialog1.RestoreDirectory =
    true;

    if (openFileDialog1.ShowDialog() == DialogResult.OK)
    {
       
    if ((myStream = openFileDialog1.OpenFile()) != null)
       {
          
    FinalCertificate = new Document(myStream);
          txtCertificate.Text = openFileDialog1.FileName;
          btnProcess.Enabled = FinalList !=
    null;
          myStream.Close();
       }
    }
    }

    Thanks for your time

    Steeve

     
  •  11-07-2011, 9:55 AM 340596 in reply to 340584

    Re: Mail merge: Template containing images with variation

    Hi

     

    Thank you for additional information. I managed to reproduce the problem on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is resolved.

     

    Best regards, 


    Alexey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
View as RSS news feed in XML