Solved

Integrating WordPerfect and VB6

Posted on 2002-05-08
8
212 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 3

Expert Comment

by:n_narayanan
ID: 6998051
0
 
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses
Course of the Month2 days, 18 hours left to enroll

621 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