Solved

Integrating WordPerfect and VB6

Posted on 2002-05-08
8
199 Views
Last Modified: 2008-02-01
I'm using VB 6 and I need to open and save a Word Perfect document.  I also need to do this with the withevents keyword so that I can determine when the document has been closed.

I know how to do this without using the withevents but whenever I use that keyword things will not work anymore.  

Does anyone have any sample code that shows how to open and save a file with the withevents keyword so that I know when the file closes..

TIA

J.

0
Comment
Question by:jtjcomp
  • 4
  • 2
  • 2
8 Comments
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6997019
Which program do you use to save the files, wordperfect?
The WithEvents statement only works if object supports events.
For intance, Word support events so if you use:
dim withevents wdapp as word.application
it will returns event to your app, but if you use (following same example):
dim withevents cmdbar as commandbarbutton
it doesn't works since commandbarbutton objects doesn't expose them.
Further details will be nice.
0
 
LVL 1

Author Comment

by:jtjcomp
ID: 6997132
I'm using the Wordperfect class.  When i dim it withevents i have to choose between wordperfect.globalmacros or wordperfect.document.

When I dont use withevents I get two more choices perfectscript and application.

If i dont use withevents I can do the file open and save fine, The following code does that

'        Set WPApp = New WordPerfect.PerfectScript
'        Set WPApp = CreateObject("WordPerfect.perfectscript")
'        WPApp.AppMaximize
'        WPApp.FileOpen strDocLocation & strDocument

Since I want to use the withevents I'm forced to use wordperfect.document instead of wordperfect.perfectscript.  I dont know how to use wordperfect.document to open or save a file.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6997171
Unfortunatelly, i don't have that class but it appears like it doesn't expose events that you need.
When you try create it withevents...
is it available in code window, objects combo box?
0
 
LVL 3

Expert Comment

by:n_narayanan
ID: 6998051
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 3

Expert Comment

by:n_narayanan
ID: 6998053
An article on this also

http://www.freevbcode.com/ShowCode.Asp?ID=4021

Cheers

Narayanan
0
 
LVL 1

Author Comment

by:jtjcomp
ID: 6998757
The code looks good, but he is not monitoring when the document exits hence the withevents.

Is this impossible to do in VB?

0
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 100 total points
ID: 6998833
Not only from VB but every language that supports COM.
As i told you, if class doesn't expose those events, you cannot access it.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7065028
"The code looks good..."
Then, why did you accept my comment as answer?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now