View Single Post
 
Old 08-07-2021, 11:27 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,142
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Frankly I have no idea what it is that you are trying to do, not helped by my unfamiliarity with Spanish.

Your 'What I Want' document seems to bear no relationship to your template, and trying to work with a PDF file of data is not really practicable. I would start by opening that PDF in Word and save it as a document. You can then populate your userform combobox as follows:


Code:
Dim oDoc As Document
Dim oTable As Table
Dim oRng As Range
Dim sName As String

    Set oDoc = Documents.Open(ThisDocument.Path & "\TERMINOS Y KILOMETROS.docx")
    For Each oTable In oDoc.Tables
        Set oRng = oTable.Cell(1, 1).Range
        oRng.End = oRng.End - 1
        sName = Split(oRng.Text, " ")(0)
        cbovia.AddItem sName
    Next oTable

As for the rest it is anyone's guess what you want. However if you have the converted data document open you can interrogate the tables to get what information you want for your document.


I would suggest that you use content controls, rather than bookmarks which are easily deleted.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote