home *** CD-ROM | disk | FTP | other *** search
/ PDA Software Library / pdasoftwarelib.iso / PILOT / support / DOC2PRC / PRC2TXT.TXT < prev    next >
Encoding:
Text File  |  1997-04-11  |  941 b   |  41 lines

  1. 'Word v6.0 macro to convert a .PRC or .PDB document into a temporary 'text file, and then open it.
  2.  
  3. 'Written April 1997 by D A MacLeod, davmac@bigfoot.com
  4.  
  5. Sub MAIN
  6.  
  7. 'file locations and constants
  8. MakeDoc$ = "c:\pilot\add-on\makedoc7.exe"
  9. TempDoc$ = "c:\temp\fred.txt"
  10. OpenFrom$ = "c:\pilot\add-on"
  11. FileMask$ = "*.prc;*.pdb"
  12.  
  13. 'Change to the directory where the forms are located
  14. ChDir OpenFrom$
  15.  
  16. 'Choose which .PRC or .PDB file
  17. Dim dlg As FileOpen
  18. GetCurValues dlg
  19. dlg.Name = FileMask$
  20. On Error Goto Done
  21. Dialog dlg
  22. On Error Goto 0
  23.  
  24. 'Start Makedoc and convert the DOC file to a temporary text file
  25. Shell MakeDoc$ + " -d " + dlg.Name + " " + TempDoc$, 0
  26.  
  27. 'Wait until conversion has finished
  28. WaitMsg$ = "Converting " + dlg.Name
  29. While AppIsRunning("makedoc")
  30.     WaitMsg$ = WaitMsg$ + "."
  31.     Print WaitMsg$
  32.     For Delay = 1 To 100
  33.     Next Delay
  34. Wend
  35.  
  36. 'Open the temporary text file
  37. FileOpen TempDoc$
  38.  
  39. Done:
  40.  
  41. End Sub