Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need to open a WordPerfect Document via OLE
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00490919
Message ID:
00547060
Views:
24
Thanks for the tip on the book. By Whilfest, I assume you mean the GLGD Workshop. Wish I could but the exchange rate makes things to tight for me.

>Great tip. Sure beats the kludgy way I went about it. You want to look into getting a copy of OLE Automation by Tamar Granor and Della Reese. It is available from HentzenWerke books. It applies direclty to Word, Excel and PowerPoint but I was able to use it to figure out WordPerfect also.
>
>Are you going to Whilfest in October?
>
>Thanks.
>
>>Hi Ken,
>>
>>Thanks for the info.
>>
>>FYI - While waiting I discover a utility in WordPerfect Office 2000 called OleCI.exe which I found in C:\Program Files\Corel\SDK 2000\Tools\. If I have Excel open (VB, QuattroPro and others can be used but I used Excel) and then run OleCI.exe I get a window called Code Inserter for Excel. I left click MergeCode in the left window and it shows me the parameters and the Enumerations for the Codes parameter. If I double click the Enumeration of Field!, 76 appears in the parameter value window. Very handy.
>>
>>This has definitely made the process easier but I'm still finding mailmerging in WP to be a major PITA because it wants to convert everything and isn't merging my comma/quote delimited text file properly. Instead of merging the first line as the field names like Word does it includes it as data and thinks each line is one field. PITA.....royal PITA.
>>
>>>Sorry for the delayed response. To actually get the value is a little tricky and will take some guess work- but then we thrive on these challanges.
>>>
>>>Go the the object browser in the Visual Basic Editor. Search for MergeCode. Select MergeCode in the top window, right Click on it, and select Show Hidden Members from the pop up. Then select MergeCode in the lower window and double click on it(Isn't VB fun!). This should show you a list of the enum constants. Scrool down the list unitl you find the one you need. In this case I found two candidates Field_Merge_Code and FieldNames_Merge_Code. Select one of these and you will see the constant vlaue in the gray display are at the bottom of the Obeject browser window. Here is where the guess work comes in:
>>>
>>>Assuming the Field_Merge_Code is the one we need the VFP command would read:
>>>
>>>oWP.MergeCode(76,"SCHOOL")
>>>
>>>where oWP is the object reference to the WordPerfect object. Place this in your code- if it doesn't work try the FieldNames_Merge_Code value 0f 78.
>>>
>>>HTH
>>>
>>>>Ok, got that. Do you know what vartype enum is? I'm doing a merge and one of the lines in the macro is:
>>>>
>>>>MergeCode(Codes: Field!; String: "SCHOOL")
>>>>
>>>>In the Object Browser, it says the following for MergeCode:
>>>>
>>>>Sub MergeCode(Codes As MergeCode Codes enum, [String As String])
>>>>
>>>>I don't know what the first parameter should be.
>>>>
>>>>
>>>>
>>>>>>"Using the VB editor in Wordperfect9 I figured out the commands to use for the Automation."
>>>>>>
>>>>>>Hi Ken,
>>>>>>
>>>>>>I was wondering if you could outline for me how/what you did to figure out the Automation commands.
>>>>>>
>>>>>>Thanx,
>>>>>>
>>>>>>Colin Magee
>>>>>
>>>>>Colin,
>>>>>
>>>>>Open up wordPerfect 9. Select Visual Basic from the Tools menu and pick Visual Basic Editor. When you are in the Editor choose Object Browser from the View menu. The object browser allows you to look up any command and get the parameter list, constants, etc.
>>>>>
>>>>>Now as for knowing what commands you need, record a macro to do what you want and then look at the commands WordPerfect records.
Colin Magee
Team Leader, Systems Development
Metroland Media Group Ltd.
Mississauga, Ontario, Canada

cmagee@metroland.com

Never mistake having a career with having a life.
Previous
Reply
Map
View

Click here to load this message in the networking platform