View Single Post
  #1   Report Post  
Alejandra Parra
 
Posts: n/a
Default Label merge in code

I'm merging labels in code (in VB .Net)

I have the next code:

Dim doc1 As New Object 'Dim doc1 As New Word.Document
doc1 = CreateObject("Word.Document")
doc1 = app1.Documents.Add(documenttype:=Documento_Tipo_Do cumento)
'Word.WdDocumentType.wdTypeDocument
doc1.MailMerge.MainDocumentType =
DocumentoPrincipal_Tipo_EtiquetasDistribucion
'Word.WdMailMergeMainDocType.wdMailingLabels
doc1.MailMerge.OpenDataSource(strBD, linktosource:=True, Connection:="VIEW "
& strTipo, sqlstatement:="SELECT * FROM `" & strTipo & "`")
doc1.MailMerge.Application.MailingLabel.LabelOptio ns()

But in a computer with Word 2000 the next error is shown:

System.MissingMemberException: Public member 'LabelOptions' on type
'MailingLabel' not found.

Why is it?

TNX

Alejandra Parra
Mexico