dbTalk Databases Forums  

VFP 6: OLE Automation: Excel and Word

comp.databases.xbase.fox comp.databases.xbase.fox


Discuss VFP 6: OLE Automation: Excel and Word in the comp.databases.xbase.fox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Gene Wirchenko
 
Posts: n/a

Default VFP 6: OLE Automation: Excel and Word - 08-26-2004 , 11:44 PM






I need the basics for the OLE Automation APIs for Excel and Word.
In case it makes a difference, I have Office 97. Googling did not
find me much. Any pointers would be appreciated.

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.

Reply With Quote
  #2  
Old   
Fred Taylor
 
Posts: n/a

Default Re: VFP 6: OLE Automation: Excel and Word - 08-27-2004 , 12:25 AM






For VFP6, this would be a real good place to start since you don't have
Intelisense to help out.

http://www.hentzenwerke.com/catalog/autofox.htm

But what you can do is create a macro in Word/Excel, and convert that code
to VFP syntax. It's not all that different, once you get the hang of it.

You will need the main Application object to get started:

oWord = CREATEOBJECT("Word.Application")
oExcel = CREATEOBJECT("Excel.Application")

Fred
Microsoft Visual FoxPro MVP


"Gene Wirchenko" <genew (AT) mail (DOT) ocis.net> wrote

Quote:
I need the basics for the OLE Automation APIs for Excel and Word.
In case it makes a difference, I have Office 97. Googling did not
find me much. Any pointers would be appreciated.

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.



Reply With Quote
  #3  
Old   
Dan Freeman
 
Posts: n/a

Default Re: VFP 6: OLE Automation: Excel and Word - 08-27-2004 , 01:00 AM



Only two Foxpro functions are involved: Getobject() and Createobject().

Beyond that, it's all up to Word and Excel.

You'll need their VBA help files. If memory serves, Office 97's "complete"
install isn't as complete as it may sound and didn't include the VBA help
files. You need to re-run setup and choose a custom install to explicitly
get the VBA help files.

Once that's done, open the VBA editor in Word (or Excel) by pressing
alt-F11. Once in there, press F2 to get to the object browser (or F1 to get
to help).

Dan

Gene Wirchenko wrote:
Quote:
I need the basics for the OLE Automation APIs for Excel and Word.
In case it makes a difference, I have Office 97. Googling did not
find me much. Any pointers would be appreciated.

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.



Reply With Quote
  #4  
Old   
Bill Browne
 
Posts: n/a

Default Re: VFP 6: OLE Automation: Excel and Word - 08-27-2004 , 01:07 AM



Gene,
In addition to what others have told you, check the MS knowledgebase. They
have some articles that will help you get started.

--
Bill Browne
www.edgefinderstudios.com


"Gene Wirchenko" <genew (AT) mail (DOT) ocis.net> wrote

Quote:
I need the basics for the OLE Automation APIs for Excel and Word.
In case it makes a difference, I have Office 97. Googling did not
find me much. Any pointers would be appreciated.

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.



Reply With Quote
  #5  
Old   
Dan Freeman
 
Posts: n/a

Default Re: VFP 6: OLE Automation: Excel and Word - 08-27-2004 , 01:25 AM



Oh, and by the way....

I had an article in the July, 1999 issue of Foxpro Advisor that was all
about discovering what was available with automation.

If you've got 'em sitting around, you might find it useful.

Dan



Reply With Quote
  #6  
Old   
toylet
 
Posts: n/a

Default Re: VFP 6: OLE Automation: Excel and Word - 08-27-2004 , 03:10 AM



On 2004-08-27, Fred Taylor <ftaylor (AT) mvps (DOT) org!REMOVE> wrote:
Quote:
For VFP6, this would be a real good place to start since you don't have
Intelisense to help out.
True expert in Foxpro doesn't need intellisense.


--
.~. Might, Courage, Vision. In Linux We Mutate.
/ v \ http://www.linux-sxs.org
/( _ )\ Linux 2.4.27
^ ^ 3:08pm up 19:48 1 user 1.00 0.98


Reply With Quote
  #7  
Old   
Fred Taylor
 
Posts: n/a

Default Re: VFP 6: OLE Automation: Excel and Word - 08-27-2004 , 11:04 AM



So what's being an expert in FoxPro got to do with the automation models of
other products? <g>

Fred
Microsoft Visual FoxPro MVP

"toylet" <toylet (AT) hotpop (DOT) com> wrote

Quote:
On 2004-08-27, Fred Taylor <ftaylor (AT) mvps (DOT) org!REMOVE> wrote:
For VFP6, this would be a real good place to start since you don't have
Intelisense to help out.

True expert in Foxpro doesn't need intellisense.


--
.~. Might, Courage, Vision. In Linux We Mutate.
/ v \ http://www.linux-sxs.org
/( _ )\ Linux 2.4.27
^ ^ 3:08pm up 19:48 1 user 1.00 0.98



Reply With Quote
  #8  
Old   
EFG NewsPost
 
Posts: n/a

Default Re: VFP 6: OLE Automation: Excel and Word - 08-27-2004 , 11:20 PM



Gene ? You tried Google on your dial up conn and did not 'get much' ? I
sense you used the wrong search terms.

USE
'vfp automation word'

and you'll find all the references you need.
This is one of the bibles:
http://www.civilsolutions.com.au/hwb...tofoxtable.htm
and it came up on page ONE.
what were you using for search terms in google, may one ask? [and expect
your answer?]

This one seems pertinent to your 'dev' environment [vfp6/off97]
http://home.att.net/~john.harvey/vfpstuff.htm

snogs round the ankles [Bill]
--
ps - are my search terms better than yours?
--
William Sanders / Electronic Filing Group Remove the DOT BOB to reply via
email.
Mondo Cool TeleCom -> http://www.efgroup.net/efgcog.html
Mondo Cool WebHosting -> http://www.efgroup.net/efglunar.html
Mondo Cool Satellites -> http://www.efgroup.net/sat
VFP Webhosting? You BET! -> http://efgroup.net/vfpwebhosting
mySql / VFP / MS-SQL

"Gene Wirchenko" <genew (AT) mail (DOT) ocis.net> wrote

Quote:
I need the basics for the OLE Automation APIs for Excel and Word.
In case it makes a difference, I have Office 97. Googling did not
find me much.





Reply With Quote
  #9  
Old   
Gene Wirchenko
 
Posts: n/a

Default Re: VFP 6: OLE Automation: Excel and Word - 08-28-2004 , 11:30 AM



"EFG NewsPost" <vfoxpro (AT) efgrip (DOT) bob.net> wrote:

Quote:
Gene ? You tried Google on your dial up conn and did not 'get much' ? I
1) Well, I had the naive idea that the information that I found
should be usable.

2) 100,000 search results does not really help.

Quote:
sense you used the wrong search terms.
No crystal ball needed for that. Sometimes, there is no set of
search terms that will do it.

Quote:
USE
'vfp automation word'

and you'll find all the references you need.
This is one of the bibles:
http://www.civilsolutions.com.au/hwb...tofoxtable.htm
and it came up on page ONE.
I knew about this book, and I will probably end up getting it. I
was hoping to find usable basics on the Web.

Quote:
what were you using for search terms in google, may one ask? [and expect
your answer?]
VFP Excel API

Hindsight is wonderful, but it always comes after.

In another (unrelated) search that I did for information on a VB
Basic TCP/IP control, I came across many sites with the same incorrect
information. No one seemed to have it right, this despite many
searches. Finally, I bothered the busy programmer who had handed the
control to me. The conversation went something like:
Why are you doing this?
That is what the documentation I have found on the Web says.
No, you do this, this, and this.
and lo and behold, doing what he said worked. No thanks to the Web on
that one.

Quote:
This one seems pertinent to your 'dev' environment [vfp6/off97]
http://home.att.net/~john.harvey/vfpstuff.htm

snogs round the ankles [Bill]
--
ps - are my search terms better than yours?
If they work. One hit was reasonable. I will keep your set in
mind when I dig more deeply into this.

There is a reason why there is something called "library
science". Librarians get degrees in it.

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.


Reply With Quote
  #10  
Old   
man-wai chang
 
Posts: n/a

Default Re: VFP 6: OLE Automation: Excel and Word - 08-28-2004 , 06:24 PM



we (I meant Foxpro programmers) don't need an automation model
We deal with data, not automation.
besides, what the heck is an automation model?

Fred Taylor wrote:

Quote:
So what's being an expert in FoxPro got to do with the automation models of
other products? <g
--
.~. Might, Courage, Vision. In Linux We Mutate.
/ v \ http://www.linux-sxs.org
/( _ )\ Linux 2.4.27
^ ^ 6:22am up 2 days 11:02 load average: 1.05 1.02 1.00


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.