Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WordPerfect from Visual Basic .Net

Status
Not open for further replies.

ericksoda

Programmer
Oct 22, 2001
60
0
0
US
I have some word perfect files (200K+) that I need to open with a VB program and then make some formatting changes. Is there a control like the RICHTEXTBOX control that allows me to open a .wpd file and then operate on it? Or could there be a WORDPERFECT.Document object like the WORD.Document?

I have searched this site and also google, but have found nothing. I have been using ConvertDoc from SoftInterface, and it works ok for batch conversions, but it fails if there is an image embedded in the document.

Thanks for any help!

David
 
Not that I know of but then I don't do much .NET.

I do know that in vba I usually use wp's wp.PlayPerfectScript() to play the shipping macro to convert files or to play PerfectScript macros that I create. "wp.MacroFilePlay" means to use wp as the WordPerfect.PerfectScript object and the MacroFilePlay() wp command.

Formatting changes usually require some wp code such as in a search and replace routine. One can easily code vba to make a batch list of files to process and then use wp.PlayPerfectScript(). Or just use one batch PerfectScript macro that allows you to specify another PrefectScript macro to play on the opened files from the batch macro.

is where I usually post my PerfectScript code snippets in that forum.
 
Thank you. That information is great.

What I need to do is remove an embedded graphic (a certification icon) from the file, and then save it as text or RTF. Is this possible from a macro?

David
 
It is easy for me to do that in PerfectScript. Doing it in vba or even vb.net should easy too. Use wp.FileOpen() first. Then use wp.BoxDelete() if you know the box number will be the same. You may want to set up a transaction data file to remove files as you process them just in case something goes wrong. I recommend backing up your first first.

You may have to get all of the boxes to determine which to delete. Use wp.GetData() to do that. I am not sure that .net will show that command from the wp's type library. Search the advanced google.com for "Hobson GetData" or just GetData and set the site to search as wpuniverse.com for some examples. Translating that to vb shouldn't be that difficult. I believe that I posted some vba examples for GetData there as well.

This won't help much since your code will be customized, but wp allows you to record macros in other languages besides PerfectScript. VBA is one that you can set in the PerfectScript utility program's Tools | Settings | Record.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top