Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ACCESSING MS WORD FROM VFP NOT ALLOWING SPACES IN DOC NAME

Status
Not open for further replies.

Nicholls

Programmer
Jan 11, 2000
4
US
I am trying to access MS Word from Visual Foxpro using the RUN command. I have the word document titles stored in a table. I can link to Word fine if the document names do not contain spaces. It stops at the space and tries to find the doc name up to the first space. It seems to accept spaces in folder names in the path statement. How can I get it to accept spaces in the document names?

Here is an example of my code, which doesn't work..

docnameloc ="C:\My Documents\Word Mail Merge test.doc"
wordpath = "C:\Program Files\Microsoft Office\Office\WINWORD.EXE"
! /N3 &wordpath &docnameloc

It works fine if I have a document name "WordMailMergetest.doc"

Linea Nicholls
 
Try this:

[tt]docnameloc ='"C:\My Documents\Word Mail Merge test.doc"'
wordpath = "C:\Program Files\Microsoft Office\Office\WINWORD.EXE"
! /N3 &wordpath &docnameloc

[/tt] Robert Bradley
teaser.jpg

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top