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

Opening MS Word document?

Status
Not open for further replies.

Zech

Programmer
Oct 14, 2002
116
US
Hi,

I am a C programmer and I have this problem concerning ms word document format. I need to open and display an ms word document inside my program. I wonder whether there is a function or method that I can use for that.

Thanks.
 
Zech

I never use API for this. I used OLE automation but not in C.
Can you use OLE from C ?

-- AirCon --
 
Do you know the name of the specific OLE function/method to use? I may be able to use it as a starting point to search in MSDN.

Thanks.
 
Not sure what your application is, but can't you embed the MS Word Viewer in your application, and then just call the document open method (Not sure of the syntax, sorry.) But this is how you can get word documents, .pdf's etc in your browser.

K
 
In VFP you can (not sure how to do this in C)
Just create an ActiveX OLE Control in form (as container) for Word. That's it.
I.E.:

With ThisForm
.AddObject('oWordDoc', 'OLEControl', 'Word.Document')
.oWordDoc.Height = .Height - 30
.oWordDoc.Width = .Width - 30
.oWordDoc.Top = .Top
.oWordDoc.Left = .Left
.oWordDoc.Visible = .T.
.Show
.oWordDoc.DoVerb(0)
EndWith

Hope it helps a bit

-- AirCon --
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top