insert linked file and link icon, but frompt for file location

M

mike

I want to insert a linked icon to a source Word document. Then I want to
insert the entire contents of the Word document, and have it linked to the
source file. I am able to do all this manually. Now I'd like a macro that
will automate the process, but prompt me for the file each time.

I used macro recorder to record the following macro. It inserts the same
document every time. I need a macro that will prompt me for a file,
preferably once (as there are two insert operations happening here), each
time I run it.


Sub insertfileandicon()
'
' insertfileandicon Macro
'
'
Selection.InlineShapes.AddOLEObject ClassType:="Word.Document.12", _
FileName:="C:\Users\Mike\Creative Work\Writing\Love at the End
v2.docx", _
LinkToFile:=True, DisplayAsIcon:=True, IconFileName:= _
"C:\PROGRA~2\MICROS~2\Office12\WINWORD.EXE", IconIndex:=1,
IconLabel:= _
"Love at the End v2.docx"
Selection.TypeParagraph
Selection.InsertFile FileName:="Love at the End v2.docx", Range:="", _
ConfirmConversions:=False, Link:=True, Attachment:=False
End Sub


I know nothing about VB code or macros. But I should be able to figure it
out with some guidance.

Thanks in advance
 
M

mike

Word 2007.

It may help if I describe what I'm trying to do in the first place. Maybe
this isn't even the best solution.

I'd like to create a single, printable, document that includes every short
story I've ever written. My "Body of Work" document.

The stories are stored in several different folders.

I'd also like this Body of Work to update any time I make changes to one of
the original stories.

I'd also like to be able to quickly open the original story for editing,
right from inside the Body of Work document.

The solution I came up with:

insert an object> create from file > Link to file & display as icon.

This gives me a single link I can click to go to the original file for quick
editing.

Then, below the link icon, I inserted the conents of the file, using Insert
object > Text from File, and selecting "Insert as Link."

This process does exactly what I want, but for a single story. Now I need
to repeat the process many times.

I'd like a macro that will perform these two insert operations, but prompt
me for the file name/location each time.
 
M

mike

I've done some more reading and found that Master Documents do pretty much
everything I'm looking for, but that they have corruption problems.

I'd like to continue looking for a way to automate the steps mentioned in my
earlier posts.

any help is appreciated.
 

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