Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
Show Folder index list in word document
Hello there, I am trying to figure out if it is possible to place a folder index list or table of contents showing the files in a specific folder. We have a folder full of video tutorials and would like to have a word doc that shows these files in a list. But if we add a video we want that list to update automatically. And if that isn't enough, can I have them linked so when clicked I can view it? thanks, Lorne -- lorne17 |
#2
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
Show Folder index list in word document
See the article "Insert into a document the names of all files in a selected
folder" at: http://www.word.mvps.org/FAQs/Macros...tFileNames.htm -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "lorne17" wrote in message ... Hello there, I am trying to figure out if it is possible to place a folder index list or table of contents showing the files in a specific folder. We have a folder full of video tutorials and would like to have a word doc that shows these files in a list. But if we add a video we want that list to update automatically. And if that isn't enough, can I have them linked so when clicked I can view it? thanks, Lorne -- lorne17 |
#3
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
Show Folder index list in word document
I'm lost on what that link is showing? It's all coding and well I don't know WORD coding. Any other methods on how to do this? Thanks for the help. Lorne PS-What does this mean: "Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis" Doug Robbins - Word MVP;2736169 Wrote: See the article "Insert into a document the names of all files in a selected folder" at: http://www.word.mvps.org/FAQs/Macros...tFileNames.htm -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "lorne17" wrote in message ...- Hello there, I am trying to figure out if it is possible to place a folder index list or table of contents showing the files in a specific folder. We have a folder full of video tutorials and would like to have a word doc that shows these files in a list. But if we add a video we want that list to update automatically. And if that isn't enough, can I have them linked so when clicked I can view it? thanks, Lorne -- lorne17 - -- lorne17 |
#4
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
Show Folder index list in word document
See the article "What do I do with macros sent to me by other newsgroup
readers to help me out?" at: http://www.word.mvps.org/FAQs/Macros...eateAMacro.htm Reur PS, it means that you should reply to the newsgroup with any additional questions UNLESS you wish to engage me to provide assistance to you personally on a pay for hire basis. My contributions to the newsgroups are free. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "lorne17" wrote in message ... I'm lost on what that link is showing? It's all coding and well I don't know WORD coding. Any other methods on how to do this? Thanks for the help. Lorne PS-What does this mean: "Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis" Doug Robbins - Word MVP;2736169 Wrote: See the article "Insert into a document the names of all files in a selected folder" at: http://www.word.mvps.org/FAQs/Macros...tFileNames.htm -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "lorne17" wrote in message ...- Hello there, I am trying to figure out if it is possible to place a folder index list or table of contents showing the files in a specific folder. We have a folder full of video tutorials and would like to have a word doc that shows these files in a list. But if we add a video we want that list to update automatically. And if that isn't enough, can I have them linked so when clicked I can view it? thanks, Lorne -- lorne17 - -- lorne17 |
#5
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
Show Folder index list in word document
Ok, This worked great. But is there a way to have this list updated automatically? It is really what we're needing. Thanks, Lorne Doug Robbins - Word MVP;2738261 Wrote: See the article "What do I do with macros sent to me by other newsgroup readers to help me out?" at: http://www.word.mvps.org/FAQs/Macros...eateAMacro.htm Reur PS, it means that you should reply to the newsgroup with any additional questions UNLESS you wish to engage me to provide assistance to you personally on a pay for hire basis. My contributions to the newsgroups are free. -- lorne17 |
#6
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
Show Folder index list in word document
It can only be updated by deleting the existing list and running the macro
again. How automatic do you need to make it? While you could create a macro that ran automatically when the document was opened, there must be some way of identifying the location of the existing list so that the macro can delete it and replace it. One way would be to have the list created inside a one cell table (without borders if desired) If that table was the first table in the document, adding the following code at the beginning of the macro would delete the contents of that table and replace it with an updated list ActiveDocument.Tables(1).Cell(1, 1).Select Selection.Delete I would recommend that you save this document as a template, and create the macro in the template and change its name to Sub Autonew() Then when you create a document from that template, the list will be updated each time. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "lorne17" wrote in message ... Ok, This worked great. But is there a way to have this list updated automatically? It is really what we're needing. Thanks, Lorne Doug Robbins - Word MVP;2738261 Wrote: See the article "What do I do with macros sent to me by other newsgroup readers to help me out?" at: http://www.word.mvps.org/FAQs/Macros...eateAMacro.htm Reur PS, it means that you should reply to the newsgroup with any additional questions UNLESS you wish to engage me to provide assistance to you personally on a pay for hire basis. My contributions to the newsgroups are free. -- lorne17 |
#7
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
Show Folder index list in word document
Ok, Adding the new code to the macro worked. A couple issues though: -It's not automatic when I open the file. How do I make it automatic? -How can I change my coding to automatically select a folder path? Not have the user select it (our folder location won't be changing). -Also, can I have this list be linked to each individual file? That way if the user clicks the name of the file, it will open that file. -Have a set font/size for list? (is this part of the macro coding?) Am I asking to much? It would be really nice for this to be this way and not have to worry about it for future users in this file. Thanks so much for your help and patience. Lorne Doug Robbins - Word MVP;2739908 Wrote: It can only be updated by deleting the existing list and running the macro again. How automatic do you need to make it? While you could create a macro that ran automatically when the document was opened, there must be some way of identifying the location of the existing list so that the macro can delete it and replace it. One way would be to have the list created inside a one cell table (without borders if desired) If that table was the first table in the document, adding the following code at the beginning of the macro would delete the contents of that table and replace it with an updated list ActiveDocument.Tables(1).Cell(1, 1).Select Selection.Delete I would recommend that you save this document as a template, and create the macro in the template and change its name to Sub Autonew() Then when you create a document from that template, the list will be updated each time. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP -- lorne17 |
#8
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
Show Folder index list in word document
Like I said, I would recommend that you save this document as a template,
and create the macro in the template and change its name to Sub Autonew() Then when you create a new document from that template, the macro will run. To hard code the folder location, replace 'let user select a path With Dialogs(wdDialogCopyFile) If .Display() -1 Then Exit Sub MyPath = .Directory End With 'strip quotation marks from path If Len(MyPath) = 0 Then Exit Sub If Asc(MyPath) = 34 Then MyPath = Mid$(MyPath, 2, Len(MyPath) - 2) End If with MyPath = "Drive:\Folder\" If you save the document as a template as I recommend, then you could also have a macro in that template that opened the selected file Dim myfile As String myfile = Selection.Paragraphs(1).Range.Text Documents.Open "Drive\Folder\" & myfile Where "Drive\Folder\" are the same as used in the code above. To apply a particular font, use With ActiveDocument.Tables(1).Cell(1, 1).Range.Font .Name = "Arial" .Size = 10 End With Change the name of the font and the size to those that take your fancy. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "lorne17" wrote in message ... Ok, Adding the new code to the macro worked. A couple issues though: -It's not automatic when I open the file. How do I make it automatic? -How can I change my coding to automatically select a folder path? Not have the user select it (our folder location won't be changing). -Also, can I have this list be linked to each individual file? That way if the user clicks the name of the file, it will open that file. -Have a set font/size for list? (is this part of the macro coding?) Am I asking to much? It would be really nice for this to be this way and not have to worry about it for future users in this file. Thanks so much for your help and patience. Lorne Doug Robbins - Word MVP;2739908 Wrote: It can only be updated by deleting the existing list and running the macro again. How automatic do you need to make it? While you could create a macro that ran automatically when the document was opened, there must be some way of identifying the location of the existing list so that the macro can delete it and replace it. One way would be to have the list created inside a one cell table (without borders if desired) If that table was the first table in the document, adding the following code at the beginning of the macro would delete the contents of that table and replace it with an updated list ActiveDocument.Tables(1).Cell(1, 1).Select Selection.Delete I would recommend that you save this document as a template, and create the macro in the template and change its name to Sub Autonew() Then when you create a document from that template, the list will be updated each time. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP -- lorne17 |
#9
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
Show Folder index list in word document
I am so sorry to keep bothering you on this matter. I really appreciate the help. I tried replacing that code with: MyPath = "Drive:\Folder\" But it doesn't work. When I place my path in there, it runs the macro with no errors and acts as if it's working, and flashes the highlighted selection in my table. But doesnt' insert any file names? Any reason why this is? This is what I have: Sub Autonew() ActiveDocument.Tables(1).Cell(1, 1).Select Selection.Delete Dim MyPath As String Dim MyName As String MyPath = "O:\Detail-Standards\Revit How To\Video Tutorials" 'get files from the selected path 'and insert them into the doc MyName = Dir$(MyPath & "*.*") Do While MyName "" Selection.InsertAfter MyName & vbCr MyName = Dir Loop 'collapse the selection Selection.Collapse wdCollapseEnd With ActiveDocument.Tables(1).Cell(1, 1).Range.Font .Name = "Arial" .Size = 10 End With End Sub With that said, what is wrong with it? Anything you see? Also, regarding your suggestion for making this a template file. We'll never need to use this macro on another file. I just wanted it to run when I open the current document not a new document with this template file. Does that make sense? Also what's the code to make the font bold? I tried: .Style = Bold. Didn't work :P I assume, there is no way to make the file names in the list links to each individual file? Thanks again!! You really are a HUUUGE HELP Lorne Doug Robbins - Word MVP;2742110 Wrote: Like I said, I would recommend that you save this document as a template, and create the macro in the template and change its name to Sub Autonew() Then when you create a new document from that template, the macro will run. To hard code the folder location, replace 'let user select a path With Dialogs(wdDialogCopyFile) If .Display() -1 Then Exit Sub MyPath = .Directory End With 'strip quotation marks from path If Len(MyPath) = 0 Then Exit Sub If Asc(MyPath) = 34 Then MyPath = Mid$(MyPath, 2, Len(MyPath) - 2) End If with MyPath = "Drive:\Folder\" If you save the document as a template as I recommend, then you could also have a macro in that template that opened the selected file Dim myfile As String myfile = Selection.Paragraphs(1).Range.Text Documents.Open "Drive\Folder\" & myfile Where "Drive\Folder\" are the same as used in the code above. To apply a particular font, use With ActiveDocument.Tables(1).Cell(1, 1).Range.Font .Name = "Arial" .Size = 10 End With Change the name of the font and the size to those that take your fancy. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "lorne17" wrote in message ...- Ok, Adding the new code to the macro worked. A couple issues though: -It's not automatic when I open the file. How do I make it automatic? -How can I change my coding to automatically select a folder path? Not have the user select it (our folder location won't be changing). -Also, can I have this list be linked to each individual file? That way if the user clicks the name of the file, it will open that file. -Have a set font/size for list? (is this part of the macro coding?) Am I asking to much? It would be really nice for this to be this way and not have to worry about it for future users in this file. Thanks so much for your help and patience. Lorne Doug Robbins - Word MVP;2739908 Wrote:- It can only be updated by deleting the existing list and running the macro again. How automatic do you need to make it? While you could create a macro that ran automatically when the document was opened, there must be some way of identifying the location of the existing list so that the macro can delete it and replace it. One way would be to have the list created inside a one cell table (without borders if desired) If that table was the first table in the document, adding the following code at the beginning of the macro would delete the contents of that table and replace it with an updated list ActiveDocument.Tables(1).Cell(1, 1).Select Selection.Delete I would recommend that you save this document as a template, and create the macro in the template and change its name to Sub Autonew() Then when you create a document from that template, the list will be updated each time. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP - -- lorne17 - -- lorne17 |
#10
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
Show Folder index list in word document
This line of code:
MyPath = "O:\Detail-Standards\Revit How To\Video Tutorials" should be: MyPath = "O:\Detail-Standards\Revit How To\Video Tutorials\" That is, it must terminate in a path separator \ -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "lorne17" wrote in message ... I am so sorry to keep bothering you on this matter. I really appreciate the help. I tried replacing that code with: MyPath = "Drive:\Folder\" But it doesn't work. When I place my path in there, it runs the macro with no errors and acts as if it's working, and flashes the highlighted selection in my table. But doesnt' insert any file names? Any reason why this is? This is what I have: Sub Autonew() ActiveDocument.Tables(1).Cell(1, 1).Select Selection.Delete Dim MyPath As String Dim MyName As String MyPath = "O:\Detail-Standards\Revit How To\Video Tutorials" 'get files from the selected path 'and insert them into the doc MyName = Dir$(MyPath & "*.*") Do While MyName "" Selection.InsertAfter MyName & vbCr MyName = Dir Loop 'collapse the selection Selection.Collapse wdCollapseEnd With ActiveDocument.Tables(1).Cell(1, 1).Range.Font .Name = "Arial" .Size = 10 End With End Sub With that said, what is wrong with it? Anything you see? Also, regarding your suggestion for making this a template file. We'll never need to use this macro on another file. I just wanted it to run when I open the current document not a new document with this template file. Does that make sense? Also what's the code to make the font bold? I tried: .Style = Bold. Didn't work :P I assume, there is no way to make the file names in the list links to each individual file? Thanks again!! You really are a HUUUGE HELP Lorne Doug Robbins - Word MVP;2742110 Wrote: Like I said, I would recommend that you save this document as a template, and create the macro in the template and change its name to Sub Autonew() Then when you create a new document from that template, the macro will run. To hard code the folder location, replace 'let user select a path With Dialogs(wdDialogCopyFile) If .Display() -1 Then Exit Sub MyPath = .Directory End With 'strip quotation marks from path If Len(MyPath) = 0 Then Exit Sub If Asc(MyPath) = 34 Then MyPath = Mid$(MyPath, 2, Len(MyPath) - 2) End If with MyPath = "Drive:\Folder\" If you save the document as a template as I recommend, then you could also have a macro in that template that opened the selected file Dim myfile As String myfile = Selection.Paragraphs(1).Range.Text Documents.Open "Drive\Folder\" & myfile Where "Drive\Folder\" are the same as used in the code above. To apply a particular font, use With ActiveDocument.Tables(1).Cell(1, 1).Range.Font .Name = "Arial" .Size = 10 End With Change the name of the font and the size to those that take your fancy. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "lorne17" wrote in message ...- Ok, Adding the new code to the macro worked. A couple issues though: -It's not automatic when I open the file. How do I make it automatic? -How can I change my coding to automatically select a folder path? Not have the user select it (our folder location won't be changing). -Also, can I have this list be linked to each individual file? That way if the user clicks the name of the file, it will open that file. -Have a set font/size for list? (is this part of the macro coding?) Am I asking to much? It would be really nice for this to be this way and not have to worry about it for future users in this file. Thanks so much for your help and patience. Lorne Doug Robbins - Word MVP;2739908 Wrote:- It can only be updated by deleting the existing list and running the macro again. How automatic do you need to make it? While you could create a macro that ran automatically when the document was opened, there must be some way of identifying the location of the existing list so that the macro can delete it and replace it. One way would be to have the list created inside a one cell table (without borders if desired) If that table was the first table in the document, adding the following code at the beginning of the macro would delete the contents of that table and replace it with an updated list ActiveDocument.Tables(1).Cell(1, 1).Select Selection.Delete I would recommend that you save this document as a template, and create the macro in the template and change its name to Sub Autonew() Then when you create a document from that template, the list will be updated each time. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP - -- lorne17 - -- lorne17 |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
very very slow when trying to open the folder list in word | Microsoft Word Help | |||
how do I save a document to a list in a file within a folder | Microsoft Word Help | |||
Folder will not show files, doing a search in folder will find it? | Microsoft Word Help | |||
How do I print a list of the items in a Word folder? | Microsoft Word Help | |||
Show the list of all fonts used in a word document | Microsoft Word Help |