![]() |
#16
|
|||
|
|||
![]()
I have managed to replace:
Code:
Application.Templates( _"L:\06. MODELOS DE DOCUMENTOS\01 ATESTADOS\ACCIDENTES DE CIRCULACIÓN\BAEI\Informe Tecnico\BAEI - INFORME TÉCNICO.dotm"). _ BuildingBlockEntries("INICIO Y EXPOSICION DE HECHOS").Insert Where:=Selection.Range, RichText _ :=True variable Ruta in: Code:
Application.Templates("Ruta"). _ BuildingBlockEntries("INICIO Y EXPOSICION DE HECHOS").Insert Where:=Selection.Range, RichText _ :=True Code:
Sub Ruta() Dim InicioRuta As String Dim FinalRuta As String Dim Ruta As String Dim NumeroAT As String InicioRuta = "L:\02.- ATESTADOS 2022\ATESTADOS PAMPLONA\2. ACCIDENTES CIRCULACION" FinalRuta = "BAEI – INFORME TECNICO.docm" NumeroAT = "\AT-1234568\" 'Here I will create a dialog for the user to indicate what AT-xxxxxxx number is going to be given. Ruta = InicioRuta + NumeroAT + FinalRuta MsgBox Ruta 'It returns the path, so this works for now. End Sub I have tried to put the same path with and without variable. With no variable, BuildingBlockEntries("INICIO Y EXPOSICION DE HECHOS") is inserted. But with the variable Ruta, no. Let me explain, this code: Code:
Application.Templates( _"L:\06. MODELOS DE DOCUMENTOS\01 ATESTADOS\ACCIDENTES DE CIRCULACIÓN\BAEI\Informe Tecnico\BAEI - INFORME TÉCNICO.dotm"). _ BuildingBlockEntries("INICIO Y EXPOSICION DE HECHOS").Insert Where:=Selection.Range, RichText _ :=True Code:
Application.Templates("Ruta"). _ BuildingBlockEntries("INICIO Y EXPOSICION DE HECHOS").Insert Where:=Selection.Range, RichText _ :=True Code:
Sub Ruta() Dim InicioRuta As String Dim FinalRuta As String Dim Ruta As String Dim NumeroAT As String InicioRuta = "L:\06. MODELOS DE DOCUMENTOS\01 ATESTADOS\ACCIDENTES DE CIRCULACIÓN\BAEI" FinalRuta = "BAEI – INFORME TECNICO.docm" NumeroAT = "\Informe Tecnico\" 'Here I will create a dialog for the user to indicate what AT-xxxxxxx number is going to be given. Ruta = InicioRuta + NumeroAT + FinalRuta MsgBox Ruta 'It returns the path, so this works for now. The message returns L:\06. MODELOS DE DOCUMENTOS\01 ATESTADOS\ACCIDENTES DE CIRCULACIÓN\BAEI\Informe Tecnico\BAEI - INFORME TÉCNICO.dotm End Sub Code:
Application.Templates("Ruta"). _ BuildingBlockEntries("INICIO Y EXPOSICION DE HECHOS").Insert Where:=Selection.Range, RichText _ :=True Last edited by gorkac; 03-21-2022 at 04:33 AM. Reason: More info |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mapped Content Controls in Building Blocks? | Charles Kenyon | Word | 6 | 05-21-2021 05:40 PM |
Stop hyperlink to a file from changing address - causes problems with pdf | c.davidson | Word | 1 | 09-15-2020 11:11 PM |
![]() |
Genericname1111 | Word | 0 | 05-20-2020 04:17 PM |
![]() |
thoerzer | Word | 5 | 10-10-2019 12:10 AM |
Changing Absolute path to Relative in a Macro | MrKim | Excel Programming | 13 | 01-26-2019 02:18 PM |