Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Search VFP Path and Subfolders for DOC files.
Message
 
To
09/03/2002 23:36:35
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00630625
Message ID:
00630678
Views:
17
>>I have the following code in Click event of a button
>>
>>lcDocument = "pcbOil.doc"
>>ThisForm.Printdoc(lcDocument)
>>
>>The custom method PrintDoc on my form is as follows:
>>
>>PARAMETERS lcDocument
>>oWord = CreateObject("Word.Application")
>>oDoc = oWord.Documents.Open(lcDocument)
>>oDoc.PrintOut()
>>
>>At the startup of my app, I establish the path in my Setup.prg file as follows:
>>SET PATH TO &gcPath
>>
>>gcPath is assigned a value earlier of h:\labtemp;h:\upsi;h:\labnav
>>
>>How do I make the line:
>>
>>oDoc = oWord.Documents.Open(lcDocument)
>>
>>properly search a subfolder beneath the folder h:\labnav named \letters for the file pcbOil.doc.
>
>Combine file() and fullpath():
>
>
if file(lcDocument)
>   lcDocument=fullpath(lcDocument)
>else
>   do what you do when file isn't there
>endif
>File() function will find your document anywhere along VFP path, and fullpath() will give its absolute path, which you can then submit to oWord.Documents.Open(lcDocument).

Dragan,

Thank you. That will work ok if I assign the value of "letters\pcbOil.doc" to lcDocument. Is there a command similar to File() that will search all subfolders on the VFP Search path?
Elgin Rogers
Epic Solutions
www.epicsolutions.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform