Hi
Very beginner ? What is code to open a word document. The .doc is already
created. It is a merge print letter.
Please be basic.
Thanks
sherry

Re: open word by Stefan

Stefan
Mon Mar 10 11:17:20 CDT 2008


"sherry" <sherry@discussions.microsoft.com> schrieb im Newsbeitrag
news:AC3C030F-B175-4FDF-9EDD-45DC9567CA52@microsoft.com...
> Hi
> Very beginner ? What is code to open a word document. The .doc is already
> created. It is a merge print letter.
> Please be basic.
> Thanks
Hi sherry -

If you want to open it anyway, you can use the API function
ShellExecute() or even the Vfp RUN command.
If you want to open it in MS Word, you'd need COM automation.


-Stefan



--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------



Re: open word by John

John
Mon Mar 10 11:23:14 CDT 2008

oWord = CreateObject('Word.Application')
oDocument = oWord.Documents.Open("MyDocument.doc") && specify full path
for mydocument.doc
oWord.Quit
Release oWord


also here is some more complex info
http://fox.wikis.com/wc.dll?Wiki~WordAutomationPrintMerge~VFP

a google search will return many more results.

A great book is
Microsoft Office Automation with Visual FoxPro

Hope this helps
John



"sherry" <sherry@discussions.microsoft.com> wrote in message
news:AC3C030F-B175-4FDF-9EDD-45DC9567CA52@microsoft.com...
> Hi
> Very beginner ? What is code to open a word document. The .doc is
> already
> created. It is a merge print letter.
> Please be basic.
> Thanks
> sherry



Re: open word by sherry

sherry
Thu Mar 13 10:34:01 CDT 2008

Hi
I've changed my plan.
I have 4 variables created.
I have a word document with 4 DocVariables

I can GETOBJECT()
*****
I can print word document.
I don't know how to code what goes in ***** to put variables into the
document.

Please help
Thanks
Sherry


"Stefan Wuebbe" wrote:

>
> "sherry" <sherry@discussions.microsoft.com> schrieb im Newsbeitrag
> news:AC3C030F-B175-4FDF-9EDD-45DC9567CA52@microsoft.com...
> > Hi
> > Very beginner ? What is code to open a word document. The .doc is already
> > created. It is a merge print letter.
> > Please be basic.
> > Thanks
> Hi sherry -
>
> If you want to open it anyway, you can use the API function
> ShellExecute() or even the Vfp RUN command.
> If you want to open it in MS Word, you'd need COM automation.
>
>
> -Stefan
>
>
>
> --
> |\_/| ------ ProLib - programmers liberty -----------------
> (.. ) Our MVPs and MCPs make the Fox run....
> - / See us at www.prolib.de or www.AFPages.de
> -----------------------------------------------------------
>
>
>

Re: open word by Stefan

Stefan
Sun Mar 16 07:21:07 CDT 2008


"sherry" <sherry@discussions.microsoft.com> wrote in message
news:E8CFA09F-5E0F-4F1D-BF5D-98C40FA5B69D@microsoft.com...
> Hi
> I've changed my plan.
> I have 4 variables created.
> I have a word document with 4 DocVariables
>
> I can GETOBJECT()
> *****
> I can print word document.
> I don't know how to code what goes in ***** to put variables into the
> document.
>
> Please help

I have not worked with MS Word "DocVariables" myself yet - however,
in general you can
- use the MSOffice Macro Recorder to track almost any interactive user
action and translate the resulting VBA code to Vfp syntax.
- read Tamar Granor's book on "Microsoft Office Automation with
Visual FoxPro", available at http://www.hentzenwerke.com/catalog/autofox.htm


hth
-Stefan



--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------