MergeFormat and CharFormat

alexransome

Board Regular
Joined
Jun 10, 2011
Messages
192
Hello,

I'm using a field code in a word document that references data in a spreadsheet.

The field code in the word document is ...

VBA Code:
LINK Excel.SheetMacroEnabled.12 "C:\\Users\\aransome\\Documents\\01.Auto\\Forms.xlsm" "VAF Word!R4C4:R13C4" \a \t\*CHARFORMAT
But I also have some code which is designed to then break the link before the file is then saved ...

VBA Code:
'Loop through fields
    For Each fld In doc.Fields
            If fld.Type = wdFieldLink Then fld.LinkFormat.BreakLink
    Next fld
However this code also adds a MERGEFORMAT tag into the link which once the code runs changes the formatting of the text in the word document.

Any ideas on how to overcome this issue?

Thanks for any help.
 

Forum statistics

Threads
1,085,755
Messages
5,385,696
Members
401,967
Latest member
Sullivag2

Some videos you may like

This Week's Hot Topics

Top