Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Yousfi Benameur
  Where is Yousfi Benameur?
 El Bayadh
 Algeria
 Yousfi Benameur
 To: Don Worrall
  Where is Don Worrall?
 Yellowknife
 Canada
 Don Worrall
 Tags
Subject: RE: Word automation problem
Thread ID: 228035 Message ID: 228713 # Views: 1 # Ratings: 0
Version: Visual FoxPro 5 Category: General VFP Topics
Date: Thursday, May 21, 2009 1:25:17 AM         
   


> >
> > The error is in loDoc.Styles("Heading 2").You must use a word constant and # define.
> >
> >
> > loWord = CREATEOBJECT("Word.Application")
> > loDoc = loWord.Documents.Open(LOCFILE(getfile('doc')))
> > loWord.Visible = .T.
> > #define wdStyleHeading2 -3
> > loWord.Selection.Style = loDoc.Styles(wdStyleHeading2)
> > 
> > loWord.Selection.TypeText("NT" + CHR(9))
> > * several more line like above
> > 
> > loDoc .Save
> > loDoc.Close
> > loWord.Quit
> > RELEASE loDoc, loWord
> > 

> >
> > Dont rate please.its only for the pleasure to help.Give me only a feed back.
> > Yousfi Benameur
>
> Thanks Yousfi, but it still doesn't work.

I tested this code for you before i posted it.please try the code and open the doc you opened and see if the text was wrote :-)

Dont rate please.its only for the pleasure to help.Give me only a feed back.
Yousfi Benameur

ENTIRE THREAD

Word automation problem Posted by Don Worrall @ 5/14/2009 11:56:42 PM
RE: Word automation problem Posted by Anders Altberg @ 5/15/2009 12:33:55 AM
RE: Word automation problem Posted by Don Worrall @ 5/15/2009 7:32:03 PM
RE: Word automation problem Posted by Anders Altberg @ 5/16/2009 1:05:24 AM
RE: Word automation problem Posted by Don Worrall @ 5/20/2009 7:13:09 PM
RE: Word automation problem Posted by Tamar Granor @ 5/15/2009 10:37:53 PM
RE: Word automation problem Posted by Don Worrall @ 5/16/2009 12:51:10 AM
RE: Word automation problem Posted by Yousfi Benameur @ 5/16/2009 10:10:24 AM
RE: Word automation problem Posted by Don Worrall @ 5/21/2009 12:37:18 AM
RE: Word automation problem Posted by Yousfi Benameur @ 5/21/2009 1:25:17 AM
RE: Word automation problem Posted by Don Worrall @ 5/21/2009 10:19:08 PM