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
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