Sobre la página que me comentas ¡¡¡ESO BUSCABA!!! GRACIAS
Sobre el código que aparece en word que son para llamar al asistente, quizá
me equivoco pero este que te pongo debajo, no es para llamar al asistente:
Public Sub MAIN()
Dim opcion$
Dim dlg As Object
Dim tipusPaper As String
opcion$ = WordBasic.[GetDocumentVar$]("ApliAcc")
Select Case opcion$
Case "FD"
On Error GoTo -1: On Error GoTo ApliApp_ErrFD
WordBasic.MailMergeEditDataSource
WordBasic.MailMergeDataForm
ApliApp_ErrFD:
WordBasic.SetDocumentVar "ERROR", Str(Err.Number)
Case "AFD"
On Error GoTo -1: On Error GoTo ApliApp_ErrAFD
WordBasic.MailMergeMainDocumentType 1
Set dlg = WordBasic.DialogRecord.MailMergeOpenDataSource(False)
WordBasic.CurValues.MailMergeOpenDataSource dlg
WordBasic.Dialog.MailMergeOpenDataSource dlg
WordBasic.MailMergeOpenDataSource dlg
ApliApp_ErrAFD:
WordBasic.SetDocumentVar "ERROR", Str(Err.Number)
Case "CE"
On Error Resume Next
'Application.MailingLabel.CustomLabels("zInst97").Delete
On Error GoTo -1: On Error GoTo ApliApp_ErrCE
Application.MailingLabel.DefaultPrintBarCode = False
Application.MailingLabel.CustomLabels.Add Name:="zInst97",
DotMatrix:=WordBasic.Val(WordBasic.[GetDocumentVar$]("EtiquetasMatricial"))
With Application.MailingLabel.CustomLabels("zInst97")
.TopMargin =
cm2p(WordBasic.[GetDocumentVar$]("EtiquetasMargenSuperior"))
.SideMargin =
cm2p(WordBasic.[GetDocumentVar$]("EtiquetasMargenLateral"))
.Height = cm2p(WordBasic.[GetDocumentVar$]("EtiquetasAlto"))
.Width = cm2p(WordBasic.[GetDocumentVar$]("EtiquetasAncho"))
.HorizontalPitch =
cm2p(WordBasic.[GetDocumentVar$]("EtiquetasExtremoHoriz"))
.VerticalPitch =
cm2p(WordBasic.[GetDocumentVar$]("EtiquetasExtremoVertical"))
.NumberAcross =
WordBasic.Val(WordBasic.[GetDocumentVar$]("EtiquetasHorizontal"))
.NumberDown =
WordBasic.Val(WordBasic.[GetDocumentVar$]("EtiquetasVertical"))
tipusPaper = WordBasic.[GetDocumentVar$]("HOJA")
' If Not .DotMatrix Then
If WordBasic.[GetDocumentVar$]("Orientacion") = "1" Then
'Orientació Horitzontal
If tipusPaper = "A4" Then
.PageSize = wdCustomLabelA4LS
ElseIf tipusPaper = "A5" Then
.PageSize = wdCustomLabelA5LS
ElseIf tipusPaper = "LETTER" Then
.PageSize = wdCustomLabelLetterLS
Else
.Application.ActiveDocument.PageSetup.Orientation =
wdOrientLandscape
.Application.ActiveDocument.PageSetup.LeftMargin =
.SideMargin
.Application.ActiveDocument.PageSetup.RightMargin =
.SideMargin
.Application.ActiveDocument.PageSetup.TopMargin = .TopMargin
.Application.ActiveDocument.PageSetup.BottomMargin =
.TopMargin
.Application.ActiveDocument.PageSetup.PageHeight =
.TopMargin + .Height + (.NumberDown - 1) * .VerticalPitch
.Application.ActiveDocument.PageSetup.PageWidth =
.SideMargin * 2 + .Width + (.NumberAcross - 1) * .HorizontalPitch
End If
Else
'Orientació Vertical
If tipusPaper = "A4" Then
.PageSize = wdCustomLabelA4
ElseIf tipusPaper = "A5" Then
.PageSize = wdCustomLabelA5
ElseIf tipusPaper = "LETTER" Then
.PageSize = wdCustomLabelLetter
Else
.Application.ActiveDocument.PageSetup.Orientation =
wdOrientPortrait
.Application.ActiveDocument.PageSetup.LeftMargin =
.SideMargin
.Application.ActiveDocument.PageSetup.RightMargin =
.SideMargin
.Application.ActiveDocument.PageSetup.TopMargin = .TopMargin
.Application.ActiveDocument.PageSetup.BottomMargin =
.TopMargin
.Application.ActiveDocument.PageSetup.PageHeight =
.TopMargin + .Height + (.NumberDown - 1) * .VerticalPitch
.Application.ActiveDocument.PageSetup.PageWidth =
.SideMargin * 2 + .Width + (.NumberAcross - 1) * .HorizontalPitch
End If
End If
' End If
End With
'WordBasic.ToolsCreateLabels
LabelDotMatrix:=WordBasic.Val(WordBasic.[GetDocumentVar$]("EtiquetasMatricial")),
_
LabelTray:=0, _
LabelAcross:=WordBasic.Val(WordBasic.[GetDocumentVar$]("EtiquetasHorizontal")),
_
LabelDown:=WordBasic.Val(WordBasic.[GetDocumentVar$]("EtiquetasVertical")),
_
SingleLabel:=0, _
LabelRow:=WordBasic.[GetDocumentVar$]("EtiquetasFila"),
_
LabelColumn:=WordBasic.[GetDocumentVar$]("EtiquetasColumna"),
_
LabelTopMargin:=cm2p(WordBasic.[GetDocumentVar$]("EtiquetasMargenSuperior")),
_
LabelSideMargin:=cm2p(WordBasic.[GetDocumentVar$]("EtiquetasMargenLateral")),
_
LabelVertPitch:=cm2p(WordBasic.[GetDocumentVar$]("EtiquetasExtremoVertical")),
_
LabelHorPitch:=cm2p(WordBasic.[GetDocumentVar$]("EtiquetasExtremoHoriz")),
_
LabelHeight:=cm2p(WordBasic.[GetDocumentVar$]("EtiquetasAlto")),
_
LabelWidth:=cm2p(WordBasic.[GetDocumentVar$]("EtiquetasAncho")),
_
AddToDocument:=1
On Error GoTo 0
With Application.ActiveDocument.PageSetup
' .Height = cm2p(WordBasic.[GetDocumentVar$]("EtiquetasAlto"))
' .Width = cm2p(WordBasic.[GetDocumentVar$]("EtiquetasAncho"))
' .HorizontalPitch =
cm2p(WordBasic.[GetDocumentVar$]("EtiquetasExtremoHoriz"))
' .VerticalPitch =
cm2p(WordBasic.[GetDocumentVar$]("EtiquetasExtremoVertical"))
' .NumberAcross =
WordBasic.Val(WordBasic.[GetDocumentVar$]("EtiquetasHorizontal"))
' .NumberDown =
WordBasic.Val(WordBasic.[GetDocumentVar$]("EtiquetasVertical"))
' If Not Application.MailingLabel.CustomLabels("zInst97").DotMatrix Then
'Tamany full
If tipusPaper = "A4" Then
.PaperSize = wdPaperA4
ElseIf tipusPaper = "A5" Then
.PaperSize = wdPaperA5
ElseIf tipusPaper = "LETTER" Then
.PaperSize = wdPaperLetter
End If
If tipusPaper <> "CUSTOM" Then
'Orientacio
If WordBasic.[GetDocumentVar$]("Orientacion") = "1" Then
'Orientacio Horitzontal
.Orientation = wdOrientLandscape
Else
'Orientacio Vertical
.Orientation = wdOrientPortrait
End If
End If
' End If
.TopMargin =
cm2p(WordBasic.[GetDocumentVar$]("EtiquetasMargenSuperior"))
.LeftMargin =
cm2p(WordBasic.[GetDocumentVar$]("EtiquetasMargenLateral"))
.RightMargin =
cm2p(WordBasic.[GetDocumentVar$]("EtiquetasMargenLateral"))
.BottomMargin = 0
End With
Set myRange = ActiveDocument.Range(0, ActiveDocument.Range.End)
'myRange.ParagraphFormat.LeftIndent =
cm2p(WordBasic.[GetDocumentVar$]("EtiquetasMargenLateral"))
ActiveDocument.Tables.Add Range:=myRange, _
NumRows:=WordBasic.Val(WordBasic.[GetDocumentVar$]("EtiquetasVertical")),
_
NumColumns:=WordBasic.Val(WordBasic.[GetDocumentVar$]("EtiquetasHorizontal"))
'ActiveDocument.Tables(1).Rows.LeftIndent =
cm2p(WordBasic.[GetDocumentVar$]("EtiquetasMargenLateral"))
ActiveDocument.Tables(1).Borders.OutsideLineStyle = wdLineStyleNone
ActiveDocument.Tables(1).Borders.InsideLineStyle = wdLineStyleNone
ActiveDocument.Tables(1).PreferredWidthType = wdPreferredWidthPoints
ActiveDocument.Tables(1).PreferredWidth =
cm2p(WordBasic.[GetDocumentVar$]("EtiquetasAncho"))
Application.MailingLabel.CustomLabels("zInst97").Delete
ApliApp_ErrCE:
WordBasic.SetDocumentVar "ERROR", Str(Err.Number)
Case "PS"
On Error GoTo -1: On Error GoTo ApliApp_ErrPS
WordBasic.FilePageSetup Tab:="1", PaperSize:="9", TopMargin:="2,5 cm",
BottomMargin:="2,5 cm", LeftMargin:="3 cm", RightMargin:="3 cm", Gutter:="0
cm", PageWidth:="21 cm", PageHeight:="29,7 cm", Orientation:=0,
FirstPage:=0, OtherPages:=0, VertAlign:=0, ApplyPropsTo:=4, FacingPages:=0,
HeaderDistance:="1,25 cm", FooterDistance:="1,25 cm", SectionStart:=2,
OddAndEvenPages:=0, DifferentFirstPage:=0, Endnotes:=0, LineNum:=0,
StartingNum:="", FromText:="", CountBy:="0", NumMode:=-1
ApliApp_ErrPS:
WordBasic.SetDocumentVar "ERROR", Str(Err.Number)
End Select
End Sub
Function cm2p(cm As String) As Single
Dim Str As String, n As Integer, sngCm As Single
Str = Left(cm, Len(cm) - 3)
If InStr(Str, ".") > 0 Then
n = Len(Mid(Str, InStr(Str, ".") + 1))
Str = Left(Str, InStr(Str, ".") - 1) & Mid(Str, InStr(Str, ".") + 1)
ElseIf InStr(Str, ",") > 0 Then
n = Len(Mid(Str, InStr(Str, ",") + 1))
Str = Left(Str, InStr(Str, ",") - 1) & Mid(Str, InStr(Str, ",") + 1)
End If
sngCm = CSng(Str) / (10 ^ n)
cm2p = Application.CentimetersToPoints(sngCm)
End Function
Public Sub GetOptions()
On Error Resume Next
WordBasic.SetDocumentVar "OptCutPaste",
Str(IIf(Options.SmartCutPaste, -1, 0))
WordBasic.SetDocumentVar "OptHidenText",
Str(IIf(Options.Application.ActiveWindow.View.ShowHiddenText, -1, 0))
End Sub
Public Sub ReFormat()
Dim Fila As Integer, Columna As Integer, nObj As Integer
Fila = WordBasic.[GetDocumentVar$]("FILA")
Columna = WordBasic.[GetDocumentVar$]("COLUMNA")
ActiveDocument.Tables(1).Cell(Fila, Columna).Select
For nObj = 1 To Selection.InlineShapes.Count
Selection.InlineShapes(nObj).Reset
Next
End Sub
--
No es la información que se comparte lo importante, es el espíritu con la
que se comparte
Hay que Enamorarse de tus fracasos.
Ojalá un día llegue a saber tanto como para saber ser siempre feliz
Un Saludo
Fernando Mollat
Zaragoza
Post by TuxPost by chiriAñado una cosilla más, si vas a visual basic, con el Apli instalado, ahí
está bastante del código, supongo que si está abierto será para que lo
podamos "leer" y utilizar sin olvidar de escribir la fuente
Hola Chiri de nuevo :-)
El codigo que aparece en esos archivos de word son para llamar al
asistente de Apli, y para la distribucion de ese asistente :-) , bien te
comento, he probado este programa y similar al que word tiene en sus
documentos :-)
Si se ve que esta hecho por tablas es mas las etiquetas de word tambien
estan basadas en tablas :-) si quieres podemos crear codigo en word para
facilitar su apertura y manejo , me explico, para tenerlas mas a mano y no
tener que estar todo el rato dandole a Herramientas > Cartas y
correspondencia > sobres y etiquetas :-)
Buen eso ya me comentas y te voy a pasar un articulo para aquello que me
comentabas de llevarnos a otro PC , las Etiquetas personales [donde se
http://support.microsoft.com/kb/211847/es
Ahi lo explican para office 2000 , pero abra que tocar registro, bueno tu
te lo lees y comentas ok?
Para office 2002
HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Word\Custom Labels
Para office 2003
HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Word\Custom Labels
Bueno comentas ok? :-)
Saludos
Monica
--
Estado: A la Espera By Fermu
Tic-Tac-Tic-Tac...
Now We are free [Enya]
www.fermu.com
------------------------