Microsoft Office Forums How to change the path of a table copied by excel in word as linked table RTF?

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-10-2014, 03:12 AM
Cristin7 Cristin7 is offline How to change the path of a table copied by excel in word as linked table RTF? Windows 7 32bit How to change the path of a table copied by excel in word as linked table RTF? Office 2010 32bit
Novice
How to change the path of a table copied by excel in word as linked table RTF?
 
Join Date: Mar 2014
Posts: 5
Cristin7 is on a distinguished road
Question 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
Reply With Quote
  #2  
Old 03-10-2014, 04:22 AM
macropod's Avatar
macropod macropod is offline How to change the path of a table copied by excel in word as linked table RTF? Windows 7 32bit How to change the path of a table copied by excel in word as linked table RTF? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,599
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

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
[MS MVP - Word]
Reply With Quote
  #3  
Old 03-10-2014, 05:01 AM
Cristin7 Cristin7 is offline How to change the path of a table copied by excel in word as linked table RTF? Windows 7 32bit How to change the path of a table copied by excel in word as linked table RTF? Office 2010 32bit
Novice
How to change the path of a table copied by excel in word as linked table RTF?
 
Join Date: Mar 2014
Posts: 5
Cristin7 is on a distinguished road
Default

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
Reply With Quote
  #4  
Old 03-10-2014, 05:25 AM
macropod's Avatar
macropod macropod is offline How to change the path of a table copied by excel in word as linked table RTF? Windows 7 32bit How to change the path of a table copied by excel in word as linked table RTF? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 19,599
macropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to beholdmacropod is a splendid one to behold
Default

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
By replacing the X with the path, the path in all such fields in the body of the document will be updated.
__________________
Cheers,
Paul Edstein
[MS MVP - Word]
Reply With Quote
Reply

Tags
table path changing

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change the path of a table copied by excel in word as linked table RTF? Determining file path for linked image in Word 2007 samhdc Word 7 01-26-2015 04:21 PM
How to change the path of a table copied by excel in word as linked table RTF? 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
How to change the path of a table copied by excel in word as linked table RTF? Displaying a Linked Excel Table joatmon Word 2 05-29-2012 06:00 PM


All times are GMT -7. The time now is 11:34 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft