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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA commands from VFP

Status
Not open for further replies.

ezpzjohn

Programmer
Jun 29, 2001
50
GB
Hi

Does anyone know the syntax for sending commands such as:

Selection.GoTo What:=wdGoToField, Name:="Date"

to Microsoft Word from VFP?

Where arguments are assigned like this I keep getting either "Unknown command" or "Syntax error" messages.

Thanks in advance.

John B.
 
John,
The important thing to know is that VFP doesn't support "named" parameters. You need to supply them in the method's expected parameter list order. This is easier if you use VFP 7.0 (Intellisense or the Object Browser), check Word's Object Model, or buy the "Microsoft Office Automation with Visual FoxPro" by Tamar Granor & Della Martin.

Rick
 
Thanks for the suggestions guys.

Tried the link Ramani but it just takes me to the Downloads page at UT - no other details. I have downloaded FRX2WORD and have tried it on simple reports on which it works fine, but I want to use Word documents that the user can put together themselves as they can be pretty heavy on text.

I am currently using Custom Document Properties (as per a previous suggestion on this forum) and they work fine. I think this is preferable to Mail Merge as it is less complex for the user and no messing with ODBC is involved for me.

The problem I have is that a Text property seems to be limited to 128 characters(?). To send a longer string than that (eg. an address in a memo field) I need to have more than one property on the form. Problem is, if a CDP is blank, I want to be able to delete the line from the Word doc which the property is on.

Many thanks to Mgagnon - the link was pretty useful as it also has reference to email, another task I need to get to grips with!

Thanks also to Rick. I haven't upgraded to VFP7 yet, but I will look out for the book as it sounds very useful.

Thanks again for all your help.

John B.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top