|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How to change the path of a table copied by excel in word as linked table RTF?
Hi,
I have copied some tables from an excel file in word as linked table RTF, how can I change by vba the path of the linked excel file? I can change it by mouse clicking on the table, but I need do it by vba. Is it possible? Thank you, Chiara |
#2
|
||||
|
||||
You can use code like:
ActiveDocument.Shapes(1).LinkFormat.SourcePath = X and: ActiveDocument.InlineShapes(1).LinkFormat.SourcePa th = X where 1 is the shape/inline shape index # and X is the path.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Hi macroprod,
thank you but the it doesn not work because the table is not a shape or an Inlineshape, indeed I tried with: ActiveDocument.Shapes.Count and with ActiveDocument.InlineShapes.Count the result is always zero. Do you have any other advices, please? Thank you |
#4
|
||||
|
||||
In which case, it's probably in a LINK field, for which you could use code like:
Code:
Dim Fld As Field For Each Fld In ActiveDocument.Fields If Fld.Type = wdFieldLink Then Fld.LinkFormat.SourcePath = X End If Next
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
table path changing |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Determining file path for linked image in Word 2007 | samhdc | Word | 7 | 01-26-2015 04:21 PM |
Help Printing Linked Graphs in Word Table | VandyGrad | Word Tables | 4 | 02-28-2014 03:12 PM |
update one embedded excel table based on another excel table | ajetrumpet | Word | 0 | 07-05-2013 08:51 PM |
Linked table of contents. | Microsoftenquirer1000 | Word | 1 | 02-11-2013 04:33 PM |
Displaying a Linked Excel Table | joatmon | Word | 2 | 05-29-2012 06:00 PM |