how to add multiple envelopes in word doc

S

srimail09

Hi all,
my requirement is to add multiple envelopes in one word document

using below code i can add only one envelope to word doc

Dim Act As Microsoft.Office.Interop.Word.Envelope

Dim WordApp As New Microsoft.Office.Interop.Word.Application

AddHandler WordApp.Quit, AddressOf WordOnQuit

Dim Doc As Microsoft.Office.Interop.Word.Document = WordApp.Documents.Add

Act = Doc.Envelope

WordApp.Selection.TypeText("VB.NET Rocks")

Dim strAddr As String

Dim strReturnAddr As String

strAddr = "ADDR" & vbCr & "123 Skye St." & vbCr & "OurTown, WA 98107"

strReturnAddr = "retADDR" & vbCr & "456 Erde Lane" & vbCr & "OurTown, WA
98107"

Act.Insert2000(Address:=strAddr, ReturnAddress:=strReturnAddr, Size:="Size
10")

WordApp.Visible = True

i want to add more than one envelope in word doc

Thanks in advance
 
T

Tony Jollans

You can only add one so-called 'envelope' to a document, but essentially it
is just a page of a particular size and shape, so you could roll your own
fairly easily. You wouldn't get the pre-positioned text boxes and you
wouldn't get addresses automatically picked up, but that feature only really
makes sense for a single envelope.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top