Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VBA and VFP
Message
From
22/06/1999 14:45:07
 
 
To
22/06/1999 10:21:38
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00228810
Message ID:
00232628
Views:
13
I don't know if anyone has gotten back to you with this by try this, it should point you in the right direction. Hopefully

1. How do I manage Word? I want to keep from opening Word each time, I would prefer to check if Word was already open, then make a hook to it or something, instead of opening it again each time. My routine creates a new document each time its run.


(Answer)
Try the GetObject("Word.Basic") this will try to hook to word if word is not open it will create an error then you must use the createobject("word.basic")
command.

Example:
X = 0
On Error X = 1
loWord = GetObject("word.basic")

IF X = 1 && Error Word In Not Open
loWord = CreateObject("Word.Basic")
ENDIF


2. I don't understand .selection and .range. My immediate need is to merge the cells in row 1 to make a header row out of it, but to do that, I need to select all the cells in that row, right?


Answer: Is this word or excel I gave You Both.
Word:
This I found tough to do i could not find a command to do this so I had to pass in keystrokes to make it happen the code looks like this.


*!* loWord.SendKeys("+{right}+{right}+{right}")
* Pause to let word catch up
*!* For I = 1 To 500000
*!* X = 0
*!* NEXT

*!* loWord.TableMergeCells

Excel:
For Excel their is a Merge command with the range object that will merge cells

Example:

loExcel = CreateObject('Excel.Application')
loExcel.Workbooks.Add
loExcel.Visible = .T.
loBook = loExcel.ActiveWorkBook
loSheet = loExcel.ActiveSheet

loSheet.Range('A1').Value = "High Level and Detail Business Requirements"
loSheet.Range("A1:B1").Borders(-4107).LineStyle = 1
loSheet.Range("A1","B1").Merge

I hope this helps
Let me know if it doesn't

Thanks
Darren Mc Dowell
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform