C
Cameron Powell
I have a feeling that this should be a really simple question, but I just
can't figure it out for the life of me. I want to have a template window that
lists all files in our networked templates directory, and shows them by title
with the icon. Just like when you click templates >> On My Computer from the
New Document Task Pane. How would I accomplish pulling the title from a
document that isn't opened. Here is the code I am using that isnt working.
Perhaps you will see what it is I am trying to do.
Sub GetTitle()
Dim Fname As Document
Set Fname = Documents("C:\BSMBCG.doc")
ftitle = Fname.BuiltInDocumentProperties(wdPropertyTitle)
Selection.InlineShapes.AddOLEObject ClassType:="Word.Document.8",
FileName _
:="C:\BSMBGC.doc", _
LinkToFile:=False, DisplayAsIcon:=True, IconFileName:= _
"C:\WINDOWS\Installer\{91130409-6000-11D3-8CFE-0150048383C9}\wordicon.exe" _
, IconIndex:=1, IconLabel:=ftitle
End Sub
I have tried numerous combinations and can't seem to come up with anything.
I keep getting Run-time error 4160. Bad File Name.
Set Fname = Documents("C:\BSMBCG.doc") this is the line that highlights upon
clicking debug.
I have checked to make sure the location is correct, and it is. Can someone
please help me!
can't figure it out for the life of me. I want to have a template window that
lists all files in our networked templates directory, and shows them by title
with the icon. Just like when you click templates >> On My Computer from the
New Document Task Pane. How would I accomplish pulling the title from a
document that isn't opened. Here is the code I am using that isnt working.
Perhaps you will see what it is I am trying to do.
Sub GetTitle()
Dim Fname As Document
Set Fname = Documents("C:\BSMBCG.doc")
ftitle = Fname.BuiltInDocumentProperties(wdPropertyTitle)
Selection.InlineShapes.AddOLEObject ClassType:="Word.Document.8",
FileName _
:="C:\BSMBGC.doc", _
LinkToFile:=False, DisplayAsIcon:=True, IconFileName:= _
"C:\WINDOWS\Installer\{91130409-6000-11D3-8CFE-0150048383C9}\wordicon.exe" _
, IconIndex:=1, IconLabel:=ftitle
End Sub
I have tried numerous combinations and can't seem to come up with anything.
I keep getting Run-time error 4160. Bad File Name.
Set Fname = Documents("C:\BSMBCG.doc") this is the line that highlights upon
clicking debug.
I have checked to make sure the location is correct, and it is. Can someone
please help me!