Link pictures by default?

J

John Leeke

Working in Word 2002:

By default, Microsoft Word embeds pictures in a document. Is it possible to
get Word to link pictures by default?

John
 
M

macropod

Hi John,

You could do that with a macro, but it would probably be best to write it so
that it doesn't automatically convert everything that gets pasted to a link,
then attach your macro to a customised toolbar button.

The macro recorder will give you the basics of how to go about pasting a
link:
Selection.InlineShapes.AddPicture FileName:= "C:\Temp\My
Pictures\Picture.gif", LinkToFile:=True, _
SaveWithDocument:=False
but you'll need to add code to browse through folders and select the file
you want, instead of using the hardcoded example above. A google search
should turn up plenty of examples.

Cheers
 
M

macropod

Hi John,

Further to my previous post, try the following macro:

Sub InsertPicture()
With Dialogs(wdDialogInsertPicture)
.Display
.LinkToFile = True
.Execute
End With
End Sub


Cheers
 
J

John Leeke

Further to my previous post, try the following macro:
Sub InsertPicture()
With Dialogs(wdDialogInsertPicture)
.Display
.LinkToFile = True
.Execute
End With
End Sub

Once again, I thank you for excellent advice. This macro appears to work
well and meets my needs. I have set it up with a toolbar button.

I am not very knowledgeable about macros.
When in the file selection dialog, using the drop-down menu for Insert,
Insert and Link, etc., has no effect. The file is always linked. This is
just fine for me. Will leaving the .LinkToFile set to True affect any other
command? Should the .LinkToFile be reset to anything in particular at the
end of the routine?

If I cancel the file selection dialog I get a run-time error message 5152.
Is there a little code that can be added to cancel gracefully?

John
 
M

macropod

Hi John,

Been offline for a few days. To avoid the run-time error, you could insert:
On Error Resume Next
as the second line. There's no need to set the LinkToFile property at the
end of the macro - it's completely volatile and won't affect anything else.

Cheers
 

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