OLEFormat.Label

H

Harry

Good Afternoon everyone:

I have an Excel document linked into my Word Document.
I inserted the link by highlighting the section of the Excel worksheet,
copying,
selecting the word document,
Paste -> Special -> Paste Link -> Microsoft Office Excel Worksheet Object

The link refers to R13C3:R16C7 in my Excel Sheet (C13:G16)

I can get the properties of the link using
ThisDocument.Fields(i).OLEFormat.Label
(where i is an integer representing the Field in Question)


How can I change the link through VBA so that it is C10:G13 of the same
Excel Sheet?

thanks,
Harry
 
D

Doug Robbins - Word MVP

With ThisDocument.Fields(i).Code
.Text = Replace(.Text, "R13C3:R16C7", "R10C3:R13C7")
End With

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
H

Harry

thanks Doug!

Doug Robbins - Word MVP said:
With ThisDocument.Fields(i).Code
.Text = Replace(.Text, "R13C3:R16C7", "R10C3:R13C7")
End With

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top