Wednesday, April 25, 2007

Linking multiple Visio pages into Word

I posted this question on AusDotNet the other day. I have reposted it here in case it may help someone...



At the risk of sounding like I am using Word for the first time today, how does one insert a DDE link from Word (aka Insert Object, Create From File,  Link to File) to the second or third page of a Visio document?  I can get the first page in just using the standard Link to File, but how do you tell it to link to the second page?



I have attempted to edit the links in Word where you can change the location of the source document and can even specify an "Item" in the source. I have entered the name  of the page in question but that did not work. It seems to be very Excel specific.

I have also attempted to split the Visio into multiple documents but since I am editing UML diagrams I then lose the automatic update of other diagrams when a shared class is edited – not good.

I have attempted to define a named range in Visio (just like you do in Excel) but it does not exist in Visio.

I am using Office 2007.


 

The answer is simple but like some parts of Visio it is totally different to the rest of Office. In Visio, select Edit->Copy drawing and then in Word, select Paste-Paste Special->Paste Link. The Copy drawing feature does not appear to be in any other Office program. The DDE does not look like it is supported.

Thanks Ken!

1 comment:

John McMullen said...

There is a way to do it, but it involves a magic incantation and two basic steps.

1. First, link the object using the Insert tab. Navigate to Insert > Object > Object > Create from file. Click Link to file, use the file browser to browse to the file, and click OK.

This places a link to the Visio file in the document with the current main page, whatever that is.

Now the obscure part.

2. Still in Word, right-click the Visio document and select Linked Visio Object > Links.

3. Select the corresponding link (I think it's usually the default) and click in Change Source

4. On the file chooser, click on the Item button and enter the following text:

Drawing\~page name

Case is important in the phrase Drawing\~ to make the link work; it doesn't seem to matter in the page name. The page name is the page you want to link to, and names with spaces are acceptable. Once you've done that, click OK.

5. Click on the file you want to link to.

6. Click OK as needed to get back to the document.

This seems to create a LINK field with various fields filled in, but my attempts to do it in one insertion using fields failed.

The ITEM button lets you choose ranges of cells in an Excel spreadsheet, too.