Re: Open Word in a specific folder
- From: "Fred Taylor" <ftaylor@xxxxxxxx!REMOVE>
- Date: Sun, 20 Jul 2008 20:15:39 -0700
Exactly as I included in the earlier message.
In the code:
LOCAL oW AS Word.Application
Now anytime you use the oW variable, when you type the ".", you'll have
Intellisense.
--
Fred
Microsoft Visual FoxPro MVP
"TonySper" <tsperduti@xxxxxxxxxxxxxxxxxxx> wrote in message
news:%23FsZQ9t6IHA.3816@xxxxxxxxxxxxxxxxxxxxxxx
Fred,
I would I use the Code Window Syntax(AS xxx)?? Never tried that. Can you
explain how I would use that??
TonySper
"Fred Taylor" <ftaylor@xxxxxxxx!REMOVE> wrote in message
news:%23F5%23Eis6IHA.4988@xxxxxxxxxxxxxxxxxxxxxxx
I'm not sure if the code window syntax (AS xxx) gets you Intellisense for
VFP8 or not. I know it does for VFP9. <s>
You do have to declare the variable (local or public, not private) for it
to work in a code editting window.
BTW, the ability to play with the object model of a control or
application in the Command Window is one of the features I absolutely
love about VFP. I can play around with lots of different things before I
commit it to actual code.
--
Fred
Microsoft Visual FoxPro MVP
"TonySper" <tsperduti@xxxxxxxxxxxxxxxxxxx> wrote in message
news:%239ZfMKs6IHA.2332@xxxxxxxxxxxxxxxxxxxxxxx
Fred,
Thank you. I was trying it using the editor and that does not work but
in the command field it does. Thanks for putting me on track.
Is there someway to get it to work when you are in the editor?? Using
VFP8
TonySper
"Fred Taylor" <ftaylor@xxxxxxxx!REMOVE> wrote in message
news:e2zJHDs6IHA.2336@xxxxxxxxxxxxxxxxxxxxxxx
Use Intellisense in VFP.
From the Command Window:
oW = CREATEOBJECT("Word.Application")
oW. && As soon as you hit the "." you get the properties and
methods of Word show up.
Some times the descriptions help though they're not always there,
depends on the control.
In a code Window:
LOCAL oW AS Word.Application
oW.
--
Fred
Microsoft Visual FoxPro MVP
"TonySper" <tsperduti@xxxxxxxxxxxxxxxxxxx> wrote in message
news:eHwfkcr6IHA.2336@xxxxxxxxxxxxxxxxxxxxxxx
Fred,
How do you find these object modals listed??? Do you go into Word and
do what??
TonySper
"Fred Taylor" <ftaylor@xxxxxxxx!REMOVE> wrote in message
news:u$MRHGq6IHA.1192@xxxxxxxxxxxxxxxxxxxxxxx
It just looked like a method that would change the folder. Tried it
and it works. If you want to see an object model that will drive you
absolutely insane try Visio.
--
Fred
Microsoft Visual FoxPro MVP
"TonySper" <tsperduti@xxxxxxxxxxxxxxxxxxx> wrote in message
news:eqhfXwp6IHA.1200@xxxxxxxxxxxxxxxxxxxxxxx
Fred,
My God that can lead to a can of worms. But you need some knowledge
to even start the properties. How did you know about
ChangeFileOpenDirectory ???
TonySper
"Fred Taylor" <ftaylor@xxxxxxxx!REMOVE> wrote in message
news:eN8Ng%23g6IHA.324@xxxxxxxxxxxxxxxxxxxxxxx
I usually just poke around a bit with InteliSense and see what's
there.
--
Fred
Microsoft Visual FoxPro MVP
"TonySper" <tsperduti@xxxxxxxxxxxxxxxxxxx> wrote in message
news:%23GLiJMf6IHA.2336@xxxxxxxxxxxxxxxxxxxxxxx
Fred,
Thanks. Works great. I played with that for an hour and could not
get it. Need a better reference than what I have. Been using
"Microsoft Office Automation with Visual FoxPro" Lots of gray
areas. Is there any better info on using Word with VFP??
TonySper
"TonySper" <tsperduti@xxxxxxxxxxxxxxxxxxx> wrote in message
news:%2346MfIf6IHA.2064@xxxxxxxxxxxxxxxxxxxxxxx
Fred,
Thanks. I want the user to name the file when he saves it but
have the
default to be a certain folder which will be different for each
record that
they open the Word doc in. I guess there would be no need for the
SaveAs.
Will try it out.
Thanks
TonySper
"Fred Taylor" <ftaylor@xxxxxxxx!REMOVE> wrote in message
news:%2349ll4e6IHA.5440@xxxxxxxxxxxxxxxxxxxxxxx
You should be able to use the
oWord.ChangeFileOpenDirectory("x:\PathStringWhereYou
WantToSave") then use the oWord.SaveAs("YourFileName").
--
Fred
Microsoft Visual FoxPro MVP
"TonySper" <tsperduti@xxxxxxxxxxxxxxxxxxx> wrote in message
news:u7RJCpe6IHA.1200@xxxxxxxxxxxxxxxxxxxxxxx
I would like to open a Word application which I have been doing
but can't figure a way so that when the user saves the file it
goes to a specific folder something like:
oWORD = CREATEOBJECT("WORD.APPLICATION")
oWORD.Visible = .T.
oDOCUMENT = oWORD.DOCUMENTS.ADD()
Now this opens word OK with a new doc file but when the user
saves it I would like the default save folder to be something
like
myfolder+'\archives\'+file_num (variable for
"C:\files\archives\number")
Any ideas or thoughts.
Thanks in advance.
TonySper
.
- Follow-Ups:
- Re: Open Word in a specific folder
- From: TonySper
- Re: Open Word in a specific folder
- References:
- Open Word in a specific folder
- From: TonySper
- Re: Open Word in a specific folder
- From: Fred Taylor
- Re: Open Word in a specific folder
- From: TonySper
- Re: Open Word in a specific folder
- From: TonySper
- Re: Open Word in a specific folder
- From: Fred Taylor
- Re: Open Word in a specific folder
- From: TonySper
- Re: Open Word in a specific folder
- From: Fred Taylor
- Re: Open Word in a specific folder
- From: TonySper
- Re: Open Word in a specific folder
- From: Fred Taylor
- Re: Open Word in a specific folder
- From: TonySper
- Re: Open Word in a specific folder
- From: Fred Taylor
- Re: Open Word in a specific folder
- From: TonySper
- Open Word in a specific folder
- Prev by Date: Re: Open Word in a specific folder
- Next by Date: Re: Foxpro 10????
- Previous by thread: Re: Open Word in a specific folder
- Next by thread: Re: Open Word in a specific folder
- Index(es):
Relevant Pages
|