Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-20-2011, 09:30 AM
PhilAJ PhilAJ is offline How do I find the Source folder? Windows XP How do I find the Source folder? Office 2007
Novice
How do I find the Source folder?
 
Join Date: Apr 2011
Posts: 7
PhilAJ is on a distinguished road
Default How do I find the Source folder?

Hope someone can help.

I've taken over managing a system for someone - and it has a lot of Word Documents that have been created as merge templates - expecting a 'merge.txt' to be available containing the fields for the merge.

What I dont know is where the merge.txt is supposed to live - ie which folder. Tried it in the same as the Word.dot documents but just get a 'Data Source Name not found..." error.

How can I tell from a document where it is expecting its data source to be ?

If I open the document and select the 'Open Data Source' icon then I can point to it and change it - but there are hundreds of these and i'd rather just find out where it expects things to be.



Help appreciated.

Phil
Reply With Quote
  #2  
Old 04-20-2011, 07:27 PM
macropod's Avatar
macropod macropod is offline How do I find the Source folder? Windows 7 32bit How do I find the Source folder? Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Phil,

If you add the following macro to, say, Word's 'Normal' template, running it will tell you whether the active document is a mailmerge main document and, if so, where it thinks the data source should be.

Code:
Sub FindmergeSource()
With ActiveDocument.MailMerge
  If .MainDocumentType <> wdNotAMergeDocument Then
    MsgBox .DataSource.Name
  Else
    MsgBox "Not A Merge Document"
  End If
End With
End Sub
For help on installing/using macros, see: http://www.gmayor.com/installing_macro.htm
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 04-21-2011, 12:33 AM
PhilAJ PhilAJ is offline How do I find the Source folder? Windows XP How do I find the Source folder? Office 2007
Novice
How do I find the Source folder?
 
Join Date: Apr 2011
Posts: 7
PhilAJ is on a distinguished road
Default

Thanks for the feedback Macropod.

I tried to add the function to the Word.dot file - but just get a msgbox with Blank.

Not sure i'm putting the code in properly;

I loaded the .dot document - it came up with the message to say that opening was going to run a command Select * etc etc ...

If I say YES then says Data Source not found; if i say No it opens.

1st tried to just add it into a code module in the .dot file - then Run thru debug...Msgbox says Blank

Then - added a button to the .dot document and put the code on it and selected Exit Design Mode - clicked the button - This time said that it wasn't a merge document.

I've renamed one of the the .dots to a .doc and attached to this message...

Your help is much appreciated

Phil
Attached Files
File Type: doc Confirmation Effective Supervision jr.doc (44.0 KB, 10 views)
Reply With Quote
  #4  
Old 04-21-2011, 02:04 AM
macropod's Avatar
macropod macropod is offline How do I find the Source folder? Windows 7 32bit How do I find the Source folder? Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Phil,

You can't test the mailmerge datasource location until after the document has opened but, in doing so, you need to either locate it for yourself if Word can't, or allow Word to remove that info from the file. Thus, before you can run the macro, you've either solved the problem or destroyed the evidence ...

What you can do when Word doesn't find the datasource is respond 'Yes' to the SQL prompt, then 'OK'. The next dialogue box tells you where the datasource was expected, including the filename. In the case of the document you posted, it's:
C:\Program Files\TakingLife\merge.txt
After noting the datasource details, you can simply cancel out of opening the document.

Although the datasource details are stored in the Word document (in the metadata towards the end of the file), I've not been able to find any code for reading that from an otherwise closed document with vba.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 04-21-2011, 02:41 AM
PhilAJ PhilAJ is offline How do I find the Source folder? Windows XP How do I find the Source folder? Office 2007
Novice
How do I find the Source folder?
 
Join Date: Apr 2011
Posts: 7
PhilAJ is on a distinguished road
Default

Thanks very much for that - it helps a lot.

Didnt give me that Path - just showed a message with DSNxjhxgh stuff in.

I can now move on though...fancy not putting the merge file where the documents are - previous programmer did this !!

Thanks Again

phil
Reply With Quote
  #6  
Old 04-21-2011, 03:23 AM
macropod's Avatar
macropod macropod is offline How do I find the Source folder? Windows 7 32bit How do I find the Source folder? Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Putting the data source anywere under "C:\Program Files\" is very strange - they should go in a public data folder, a particular folder under the user's profile or, as you say, perhaps the same folder as the mailmerge main document.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 04-22-2011, 05:45 AM
PhilAJ PhilAJ is offline How do I find the Source folder? Windows XP How do I find the Source folder? Office 2007
Novice
How do I find the Source folder?
 
Join Date: Apr 2011
Posts: 7
PhilAJ is on a distinguished road
Default

yes agreed - a few funnies in the system - hence the client asking me to take it on...

Thanks again
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I find the Source folder? Outlook 2010 View Source tbragsdae Outlook 2 07-25-2012 06:33 PM
tracking source when pasting between documents kirko Word 0 08-22-2010 09:15 PM
Can't find Task Folder kc300c Outlook 0 08-02-2010 09:22 PM
Issue with formula's from an outside source phroche Excel 0 11-07-2008 03:08 PM
Installation Source Corrupted browneyes Office 1 01-23-2006 02:33 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:11 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft