Sign UpSign Up   Sign InSign In Welcome Guest,
Live Chat Live Chat

Envelope object support?

Last post 10-31-2010, 10:50 AM by emoreau. 25 replies.
Page 1 of 2 (26 items)   1 2 Next >
Sort Posts: Previous Next
  •  07-19-2010, 3:53 PM 249393

    Envelope object support? .NET

    Hi

    Do you support something like the Envelope object of Word Automation?

    I was asked to print addresses on envelopes (for the client currently selected in my application) and I am looking for the best way to do it.

    Or maybe you have good suggestions!

     
  •  07-19-2010, 4:52 PM 249399 in reply to 249393

    Re: Envelope object support?

    Hi Eric,

    Thanks for considering Aspose. Yes this sounds easy to do using Aspose.Words. I believe the quickest way to do this is to set up a letter template in your word document and then use mail merge. Please see the documentation page here for full information regarding mail merge.

    If you have any queries please feel free to ask.

    Thanks,


    Adam Skelton
    Programming Writer
    Aspose Auckland Team
     
  •  07-21-2010, 6:44 PM 249795 in reply to 249399

    Re: Envelope object support?

    Attachment: Present (inaccessible)

    Hi

    I have created a template and i cannot get it to work correctly.

    If I use this code, it correctly creates the test.docx document with the correct address:

                Dim doc As New Document(IO.Path.Combine(Base.App.PathReports, "Envelope10.docx"))
                doc.MailMerge.Execute(New String() {"Address"}, New Object() {pAddress})
                doc.Save("c:\temp\test.docx")

                doc = Nothing
                Return True

    But if I try to print it, a blank page comes out of the printer:

                Dim doc As New Document(IO.Path.Combine(Base.App.PathReports, "Envelope10.docx"))
                doc.MailMerge.Execute(New String() {"Address"}, New Object() {pAddress})
                'doc.Save("c:\temp\test.docx")

                doc.Print()
                doc = Nothing
                Return True

    I have also attached my template.

     
  •  07-21-2010, 7:14 PM 249800 in reply to 249795

    Re: Envelope object support?

    Hi Eric,

    Please try replacing this line of code  doc.MailMerge.Execute(New String() {"Address"}, New Object() {pAddress}) with doc.MailMerge.Execute(New String() {"Address"}, New String() {"Test Address 1"})

    You may want to try testing whether this is working properly by first saving the document to disk using doc.Save("Envelope out.docx") and opening it with MS Word.

    Also the code on this documentation page regarding print preview may be helpful.

    Thanks,


    Adam Skelton
    Programming Writer
    Aspose Auckland Team
     
  •  07-21-2010, 10:07 PM 249811 in reply to 249800

    Re: Envelope object support?

    Hi

    In my first example, I save the document (in test.docx) and when I open it I can see that the merge has been done correctly.

    I have also tested passing a string as you required and it doesn't work.

    Can you try with my template?

     
  •  07-22-2010, 8:35 AM 249921 in reply to 249811

    Re: Envelope object support?

    Hi Eric,

     

    Thanks for your request. I cannot reproduce the problem on my side using your template and the latest version of Aspose.Words (9.2.0). You can download this version from here:

    http://www.aspose.com/community/files/51/.net-components/aspose.words-for-.net/category1188.aspx

     

    Best regards,


    Andrey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  07-22-2010, 8:42 AM 249927 in reply to 249921

    Re: Envelope object support?

    Hi

    I already have the latest version.

    Is the envelope printed correctly or did you just save it? Any modification to the code?

    Because I can save it but nothing prints!

     
  •  07-22-2010, 8:57 AM 249933 in reply to 249927

    Re: Envelope object support?

    Hi

     

    Your document was successfully filled with data and printed. I used the following code for testing:

     

    Document doc = new Document("Envelope10.docx");

     

    doc.MailMerge.Execute(new string[] {"Address"}, new object[] {"My Address"});

     

    PrinterSettings printerSettings = new PrinterSettings();

    printerSettings.PrinterName = "hp LaserJet 1010 Series Driver";

    doc.Print(printerSettings);

     

    Best regards,


    Andrey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  07-23-2010, 5:01 AM 250093 in reply to 249933

    Re: Envelope object support?

    I really don't understand.

    I just created a brand new C# test project, copied your code and only blank pages are printed! What I don't understand is that if I save the doc, the saved document contains the dummy "My Address".

    Any other ideas? I am about to look around for a working solution.

    BTW, I double-checked my Aspose.Words.dll component and it is version 9.2.0.0.

     

    private void button1_Click(object sender, EventArgs e)

    {

    Document doc = new Document(@"c:\_junk\Envelope10.docx");

    doc.MailMerge.Execute(new string[] { "Address" }, new object[] { "My Address" });

    //doc.Save(@"c:\_junk\test.docx");

    PrinterSettings printerSettings = new PrinterSettings();

    printerSettings.PrinterName = "Samsung SCX-4x28 Series PCL6";

    doc.Print(printerSettings);

    }

     
  •  07-23-2010, 6:34 AM 250130 in reply to 250093

    Re: Envelope object support?

    Hi

     

    Thank you for additional information. Could you please create simple application, which will allow me to reproduce the problem on my side? I will check it and provide you more information.

    Also, have you tried using other printer?

     

    Best regards,


    Andrey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  07-23-2010, 7:58 AM 250149 in reply to 250130

    Re: Envelope object support?

    Attachment: Present (inaccessible)

    You will find attached a test project.

    The demo saves the results of the mail merge correctly but only print 2 completly blank pages.

    I have also tried on another printer (so far a Samsung and a HP - both laser).

     
  •  07-23-2010, 9:11 AM 250165 in reply to 250149

    Re: Envelope object support?

    Hi

     

    Thank you for additional information. But I still cannot reproduce the problem on my side. I have changed just the printer name and the document was successfully printed (in your example it’s two pages, the one of them with data the other is empty).

     

    Best regards,  


    Andrey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  07-23-2010, 9:56 AM 250174 in reply to 250165

    Re: Envelope object support?

    I don't know what to say other then it is not working on my side.

    it is probably printing 2 pages because the license is not set (because it is a demo application).

    You can also see which version of the DLL I am using since it is in the bin folder.

    One last thing (a shot in the dark), I am on Windows 7 64-bits. Can it be related? 

     
  •  07-23-2010, 1:04 PM 250205 in reply to 250174

    Re: Envelope object support?

    Hi

     

    Thank you for additional information and patience. I managed to reproduce the problem on my side using Windows 7 as my test environment. Your request has been linked to the appropriate issue. You will be notified as soon as it is fixed.

     

    Best regards,


    Andrey Noskov
    Developer/Technical Support
    Aspose Auckland Team
     
  •  07-23-2010, 1:12 PM 250206 in reply to 250205

    Re: Envelope object support?

    This is reassuring for me. It confirms that I'm not (that) crazy!

    Do you have an ETA? If it is more then a week, I will have to find a workaround.

     
Page 1 of 2 (26 items)   1 2 Next >
View as RSS news feed in XML