Macro for inserting a files selected from a directory (on a networ

I'm looking for a macro that I could add to .dotm so that I can insert 
selected files into my main document:

From the document > click on a toolbar icon > open the correct specific 
folder to display the list of files in that folder > Select a file to insert 
it into my main document.

The reason for going this way is to let people change the word files but 
keep them out of playing with Quick Parts/Autoext in the template itself as 
files might change and the list of files int eh folder might be added to.

I had one I found on this community which worked on my home PC but I seem to 
be
struggling with it at work on the network. Getting to the folder was OK but 
I struggled to get it to insert the file as it kept looking at my C drive.

Can anyone help me?  

Thanks
0
Utf
6/3/2010 12:17:33 AM
word.vba.general 1023 articles. 1 followers. Follow

2 Replies
1818 Views

Similar Articles

[PageSpeed] 2

Show us the code that you are trying to use.

-- 
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, originally posted via msnews.microsoft.com

"Marley" <Marley@discussions.microsoft.com> wrote in message 
news:28938D38-1DE4-495D-9D3E-08CB26FF6720@microsoft.com...
> I'm looking for a macro that I could add to .dotm so that I can insert
> selected files into my main document:
>
> From the document > click on a toolbar icon > open the correct specific
> folder to display the list of files in that folder > Select a file to 
> insert
> it into my main document.
>
> The reason for going this way is to let people change the word files but
> keep them out of playing with Quick Parts/Autoext in the template itself 
> as
> files might change and the list of files int eh folder might be added to.
>
> I had one I found on this community which worked on my home PC but I seem 
> to
> be
> struggling with it at work on the network. Getting to the folder was OK 
> but
> I struggled to get it to insert the file as it kept looking at my C drive.
>
> Can anyone help me?
>
> Thanks 

0
Doug
6/3/2010 1:20:45 AM
See http://www.gmayor.com/Boiler.htm

-- 
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


"Marley" <Marley@discussions.microsoft.com> wrote in message 
news:28938D38-1DE4-495D-9D3E-08CB26FF6720@microsoft.com...
> I'm looking for a macro that I could add to .dotm so that I can insert
> selected files into my main document:
>
> From the document > click on a toolbar icon > open the correct specific
> folder to display the list of files in that folder > Select a file to 
> insert
> it into my main document.
>
> The reason for going this way is to let people change the word files but
> keep them out of playing with Quick Parts/Autoext in the template itself 
> as
> files might change and the list of files int eh folder might be added to.
>
> I had one I found on this community which worked on my home PC but I seem 
> to
> be
> struggling with it at work on the network. Getting to the folder was OK 
> but
> I struggled to get it to insert the file as it kept looking at my C drive.
>
> Can anyone help me?
>
> Thanks 


0
Graham
6/3/2010 4:51:09 AM
Reply:

Similar Artilces:

Macro -- repetitive tasks
Below is a portion of the macro (that I have cropped, original version is much longer but a lot of this is repetitive statement) that allow me to change the chart setting for a chart. I intend to change the setting for about 20 charts in a worksheet There must be a way to shorten this macro – retaining the main body of the macro but replacing the chart Name (in bold, big fonts) with N then define N= CHART_1, CHART_2, CHART_3, CHART_4 Etc etc Let the macro run for CHART_1 until the last CHART and stop there. By doing so the macro will be shorter and neat. Question: how to do write a ...

select query with aggregate?
I need to select all rows from table1 for a date range but only when 1 or more rows exist in table2 for the primary key in table1 for the same date range. What is the best way to achieve this in SQL 2005 sp4? TIA Matt Assuming you are returning the primary key in your select list. SELECT DISTINCT Table1.* FROM Table1 JOIN Table2 ON Table1.Table1ID = Table2.Table1ID WHERE Table1.MyDate BETWEEN @date1 AND @date2 -- Not sure if this is needed -- AND Table2.MyDate BETWEEN @date1 AND @date2 -- or -- SELECT Table1.* FROM Table1 WHERE Table1.MyDate BET...

Deserializing an XML (soap) file on a pocket pc into a hashtable
I am porting some code from a PC to a PocketPC. I want to read data from an XML-file into a hashtable. But since the soapformatter does not exist in the compact framework I have to find a workaround. I have tried to use xmlserializer, but it always wants me to supply it with a type. If I use the type of hashtable I get an exception. Any help or hints would be highly appreciated. Below is the code as it more or less looks in my program : [Serializable] public struct CMDCLASSES { public Hashtable CmdClasses; } public CMDCLASSES ReadXml(string filename) { Stream streamReader = null; ...

how do i export contacts from outlook to a ics file
how do i export contacts from outlook to a ics file Why would you do that? Contacts are not Calendar Items. -- Russ Valentine "Brett Wilkins" <Brett Wilkins@discussions.microsoft.com> wrote in message news:7964D532-823D-46C9-B7E3-63E12126D7E5@microsoft.com... > how do i export contacts from outlook to a ics file On 3/14/2010 3:18 AM, Brett Wilkins wrote: > how do i export contacts from outlook to a ics file You can export one contact at a time to VCF file. While some software supports multi-entry VCF files, Outlook does not as of 2007 without add-ins....

Refresh Imported Data
This probably sounds dumb - I have a spreadsheet that I have imported data from an existing dsn/odbc, I set the properties to refresh every 24 hours (1220 minutes), and on open. The file is going to be used for an orgchart in another program that imports the data from excel. I am testing that automation also, it has tasks that refresh the data from the excel file. What I don't know is if the excel spreadsheet has to be open for the refresh to occur? That is not a problem, so far, but not sure yet if I can refresh the orgchart file if the excel file is open. The files will all be...

CFile::Remove() deleted server directory!! Why?
Hello, I have a concern about something that happened on one of my live servers today. In a cleanup program I use CFile::Remove() to remove files.... but somehow it deleted an entire directory and everything in it! Microsofts documentation says that: "This static function deletes the file specified by the path. It will not remove a directory. " What happened and why can I not reproduce it on my test server? Anyone have any ideas? Did it somehow try to delete the . or .. ? I cannot get it to work with any test programs. Thank you all in advance. ...

Trying to find a rack-mount file server image
I am looking for an image of a file server, like the one below. http://www.imagedash.com/uploads/atd1243629320i.JPG However, instead of that cylinder, database, icon. I need a folder icon. It is a common image, but I can not seem to find it anywhere. "walterbyrd" <walterbyrd@iname.com> wrote in message news:4f4f9774-b07e-4418-a826-1d6d3b473775@q16g2000yqg.googlegroups.com... >I am looking for an image of a file server, like the one below. > > http://www.imagedash.com/uploads/atd1243629320i.JPG > > However, instead of that cylinder, database, icon. I need a f...

File Folder labels printing
I am trying to print labels in order to organize our file system better. there are four types of information that will appear on each label corresponding to four columns in a work sheet. i have tried to do it through mail merge but i t won't set up right . i want it to be 2 lines on label . top line woulbd be a company name left justified and a machine type right justified the second line would be set up the same. mail merge won't allow me to do this . can anyone help ? can it be done through excel alone ? i am working off office 97. Hi thisn should be possible using Word (...

i need a form to sent to customer to update there file
i need help finding a form i can send to the cutomers dont feel like making one A fill-in form? A form as email? Are you selling a service or a product? Close your eyes, click your heels three times and magically a form will all your requirements will be created. Or in Publisher, new, Publications for Print, select business forms. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "work work work" <work work work@discussions.microsoft.com> wrote in message news:2C94AB74-03F4-4B77-8F6E-58CE04C11640@microsoft.com.....

Format a Comment created by a Macro
Thanks to Ken Johnson's help I have a Comment box which appears only if a condition is met. This comment has been created by a small macro. It seems that because the comment box is not a standard Excel comment, but has been created by the macro, any attempt to format the text box (dimensions, alignment, no shadow etc) fails. It looks like the formatting has to be included in the macro, but so far I haven't been able to do this. Can anyone help? Ken can you post the code that creates the Comment box -- mudraker ---------------------------------------------------------------...

Select query help
I have tblLog. It's fields are: Call: text Freq: single Mode: text CID: text QSL_R: text Credited: T/F I need the SQL to return all records where 'Credited' is false, 'QSL_R' <> NULL or blank, and whose combination of 'Freq' and 'Mode' for a given 'CID' have 'Credited' = false, but not if that record has a 'mate' whose 'CID', 'Freq/Mode', 'QSL_R' all match, and 'Credited' is True. I'm not sure if my description is understandable, so here is an example. Call Freq Mode...

MACRO
Any help would be greatlyi appreciated. I need a macro that copys rows on a spreadsheet to another spreadsheet based on the value thats in the B column. For example, b4 has "RES" as the value, so i want row 4 to go to the first available line on the RES sheet. If it had "BOB" as the value, i would like it to go to the BOB sheet on the first available line. I would like to be able to do this with the entire sheet. Thanks! Is this a repetitive task? If not, you can use Data/AutoFilter, then copy the displayed rows to the appropriate sheet, then go on to the next name....

Merged cells when exporting reports into excel files
The excel files exported by custom reports we have made using reporting services, have a lot of merged cells. Do you have any idea why does this happen ??? Hi George, We have experienced this before and would like to share our findings Check your report to see if you have any labels added to the report... Generally Report Headings that are wide enough to extend the width of the columns below... Fix is to get to the width of the label to be equal to the width of the entire column being merged. So say you find column D and E merged. Extend the report header label to have a width wide e...

filter report from listbox without having to select any
I have a listbox which dynamically shows records when i enter criteria in a texbox using the textbox's on change event After that i want like to be able to filter a report based on the records that are currently displayed in the listbox without having to select any. Just the ones i can see at the moment. I allready have the code which gives me the ones that are selected and i need to modify it in case i dont select anything Code below------ Private Sub Command22_Click() Dim strWhere As String, varitem As Variant For Each varitem In Me.List0.ItemsSelected strWhere = strWhere & Me.L...

How to insert = in formula bar
Already this problem is posted but not answered for the right solotion? There use to be = button in the formula bar in Excell 2000 its not in excell XP, I tried with the = button from the toolbar but it did not worked as it did in excell 2000. How about clicking the fx symbol to the left of the formula bar? -- HTH Bob Phillips "Tirtha Raj Adhikari" <Tirtha Raj Adhikari@discussions.microsoft.com> wrote in message news:C02F4277-B8AC-4BE3-897A-368B2C6FFDD0@microsoft.com... > Already this problem is posted but not answered for the right solotion? > There use to be = b...

Exchange 5.5 moving into Active Directory
I need to know if I can move Exchange 5.5 into Active Directory 2003. If so is there anydocumentation somewhere for me to see. Joel: The tool you are looking for (if you are looking for a Microsoft tool) is the Active Directory Connector (the ADC). It is found on the Exchange 2003 CD-ROM or the Exchange 2003 Service Pack 1 CD or download (in the ADC directory). There are dozens of possible permutations for implementing the ADC. It will all depend on your environment. Usually (but not always), the ADC assumes that your user accounts are already created in the Active Dire...

Entire Active Directory visible when Allowing Users to Edit Ranges
Excel XP on Windows 2000. TS Environment running Citrix. Following Problem: Tools - Protection - Allow user to edit ranges - new - permissions - add. This provides a list of the ENTIRE active directory of the domain. Where is the switch to turn this off or to limit the access? Am I in the right newsgroup even? Any hints will be greatly appreciated. ...

How can I edit a comment w/o first having to select Show Comment
In an Excel doc, one worksheet out of many is afflicted with the following problem: I can not edit any comments without first having to click on Show Comments. I make the change and then have to click on Hide Comment. On all the other worksheets you can go straight to Edit Comment. We keep a lot of info in our comments and it has made more of a hassle. Try pulldown: Tools > Options... > View > and then check comments and indicator This will make the comments available for immediate editting, but make it a little more difficult getting to the cells "behind" them --...

No network drive mapping after joining Active Directory ?
We are migrating our NOS to Active Directory. On a Windows XP SP3 workstation, we are able to join Domain. However, when we log in as Domain User, it does accept Domain password but we only get local C drive (No Network Drive at all). We have tried using different users (with administrative right) to log in but get the same result. Your advice is sought. Howdie! On 21.04.2010 12:38, Patrick wrote: > We are migrating our NOS to Active Directory. > > On a Windows XP SP3 workstation, we are able to join Domain. > > However, when we log in as Domain User, i...

Problem again with Downloading OFX files
This is a multi-part message in MIME format. ------=_NextPart_000_002C_01C57641.B290E800 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, I previously had a problem downloading OFX files. The problem went away = and I never understood what caused the problem. The error I get is as follows: "A communication error occurred. Please try your call again. If you = continue=20 to have problems call your financial institution's Online Services = Customer=20 Support." It happens at multiple banks and also happens whether I...

Macros & pie charts
When using Excel in Microsoft 2000 - I want to create a macro that will produce a pie chart for 2 rows of data in column B and then repeat this for columns C, D, E etc. until there is no longer any data. The labels are in column A. To get the base code, turn on the macro recorder, create the pie chart by hand, and turn off the recorder. XL will give you the necessary code, which can then be customized and generalized. If you don't know how, share the code you have and someone should be able to help you out. -- Regards, Tushar Mehta www.tushar-mehta.com Multi-disciplinary busin...

help
Hi Outlook Express has a facility to break apart large messages as a sender & to re-combine multipart messages as a recipient. I see no way to do this in the upmarket paid for Outlook programme. Any ideas on recombining split messages in Outlook? Have tried all the help files. Richard -------------------------------------------------------------------------------- I am using the free version of SPAMfighter for private users. It has removed 2532 spam emails to date. Paying users do not have this message in their emails. Try SPAMfighter for free now! Richard Webb <richard_p_web...

troubleshoot inserting columns in a spreadsheet
Cannot insert columns in a worksheet - gives an error message: To prevent possible loss of data, Microsoft Office Excel cannot shift nonblank cells off the worksheet. Try to locate the last nonblank cell by pressing Ctrl + End, and delete or clear all in cells between the last cell and the end of your data. The select cell A1 and save your workbook to reset the last cell used. Or, you can move the data to a new location and try again. I have followed the instructions, but no help. any thoughts??? Hi Quinn, Using the scroll bar at the bottom of your screen, scroll to the right as far r...

removing footers from publisher 2002 file?
somehow, I don't know how, an unwanted FOOTER is in place at the bottom of the page of a Microsoft Publisher XP file. The HELP file that comes with the software did not offer instructions on how to remove it. Can anyone reading this offer a suggestion on how to completely remove it (cut it out)? all replies welcomed! Aaron Hi aaronep@pacbell.net (aaronep@pacbell.net), in the newsgroups you posted: || somehow, I don't know how, an unwanted FOOTER is in place at the || bottom of the page of a || Microsoft Publisher XP file. The HELP file that comes with the || software did not ...

Can I select Picklist Value in View to sort by name instead of val
I have a picklist new_Company in a Custom Entity. When we select the Company in the Header of the View, the sort is by int Value, not by the Label (Company Name). Is this a problem because with the Custom Entity? I noticed the Case Type in Cases sorts Alphabetically, not by the Value. Any workarounds? Thank you! Something is wrong. We have many custom enities with new picklist attribute. In a view, it is sorted alphabetically. I'd just confirmed it in one of our 4.0 environments. Try testing it out with another new picklist attribute to see if it behaves the same. Frank Le...