Creating Envelope and labels from web application

ny3ranger

Member
Joined
Feb 25, 2005
Messages
5
Programming Experience
1-3
Hey,
So I have a activexobject script on a vb.net webapplication thats passing parameters to word and it opens up the envelope and labels of word and fills out an address. It works in word 2003 but just noticed that its not working in 2007. Anyone have any ideas on how I can get around this problem. Any help would be greatly appreciated. Code snippet below.


---------------------------------------
function Button3_onclick() {


var w=new ActiveXObject("Word.Application");
var docText;
var obj;
var addr;

if (w != null)
{

w.Visible = true;
obj=w.Documents.Add();

var Name = document.getElementById("txtPOIFirstName").value + " " + document.getElementById("txtPOILastname").value;
var Address1 = document.getElementById("txtPOIAddress").value;
var Address2 = document.getElementById("txtPOIAddress2").value;
var city = document.getElementById("txtPOICity").value;
var ostate = document.getElementById("ddlPOIState");
var state = ostate.options[ostate.selectedIndex].text;
var zip = document.getElementById("txtPOIZipcode").value;
var ocountry = document.getElementById("ddlPOICountry");
var country = ocountry.options[ocountry.selectedIndex].text;
addr = Name + "\r" + Address1 + "\r" + Address2 + "\r" + city + ", " + state + " " + zip + "\r" +country;
//addr = "Tashfin Wahid";
obj.Envelope.Insert(true,addr);

var dialog;
dialog = obj.Application.Dialogs(607);
dialog.DefaultTab = 800000;
dialog.addrtext = addr;
dialog.Show;

}

}


----------------------------------------
 
Top Bottom