View Single Post
 
Old 11-08-2019, 06:00 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,106
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 of
Default

The following should do the trick

Code:
Sub Macro1()
Dim oLink As Hyperlink
Dim oTable As Table
Dim i As Integer
Dim strInvoice As String
Dim strAmount As String
    Set oTable = ActiveDocument.Sections(1).Footers(wdHeaderFooterFirstPage).Range.Tables(1)
    strInvoice = oTable.Range.Cells(7).Range
    strInvoice = Left(strInvoice, Len(strInvoice) - 1)
    strAmount = oTable.Range.Cells(10).Range
    strAmount = Left(strAmount, Len(strAmount) - 1)
    Set oLink = ActiveDocument.Sections(1).Footers(wdHeaderFooterFirstPage).Range.Hyperlinks(1)
'Debug.Print oLink.Address
    oLink.Address = Replace(oLink.Address, "(+HD.ProformaNr+)", strInvoice)
    oLink.Address = Replace(oLink.Address, "(+DT.EURO+)", strAmount)
'Debug.Print oLink.Address
    Set oLink = Nothing
    Set oTable = Nothing
End Sub
__________________
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