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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying WinWord document in OLE Control

Status
Not open for further replies.

LetukaS

Programmer
Jan 10, 2011
3
ZA
Hi,
I want to display a .doc or .docx on an OLEControl within my Powerbuilder window, I don't want it to pop up in the MS Word window. I am using a Standard Control OLEControl for MS Word, everytime I call the Open function it pops the microsoft window and nothing shows on my OLE Control.

Need a nudge in the right direction here.
 
Try

Code:
String lFileNameWithFullPath, lFileName
Integer lResult

lResult = GetFileOpenName( "Select Document to Open in OLE Control", lFileNameWithFullPath, &
lFileName, "Doc", "Documents (*.doc), *.doc" )

If lResult <> 1 Then Return

lResult = ole_1.InsertClass( "word.document" )

If lResult <> 0 Then
  MessageBox( "Error while inserting Class", "Error No: " + String( lResult ) )
  Return -1
End If

lResult = ole_1.Open( lFileNameWithFullPath )

If lResult <> 0 Then
  MessageBox( "Error while opening the specified Class File", "Error No: " + String( lResult ))
  Return -1
End If

Matt

"Nature forges everything on the anvil of time"
 
I resorted to using dsoFramer to solve my problem, and helped overcome the cumbersome job of hiding the 'ribbon' on msword.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top