How can I open a word document in C++ with a CNiWordApplication object?

Hello,
For an application, i need to open a word document using VisualC++ and CNiWord classes (CNiWordApplication, CNiWordDocument...). I successed to create a new CNiWordDocument with the CNiWordApplication CreateDocument() function. But when using the OpenDocument() I have error message about violation error. Must I create another objet before calling the OpenDocument() function? Is it possible to have an example of code to open a word document?
Thank you for your help.

I tried the following code to open a doc file in an MFC application.
CNiWordApplication word;
CNiWordDocument doc = word.OpenDocument("c:\\books.doc");
This worked fine for me. I tried this with Word 2003 and Measurement Studio 7.1
Try running one of the shipping examples. You can find examples for this under ..\MeasurementStudio\VCNET\Examples\Office\
Hope this helps.
Bilal Durrani
NI

Similar Messages

  • HT202879 how can I open a Word document in Pages 09?

    How can I open a Word document using Pages 09 please? I am trying to open Word documents from a CD using both trying to open in Pages, nd dragging and dropping into the Pages icon in the dock. It tells me, every time, thast the document cannot be opened.

    What happens if you open it in TextEdit or LibreOffice [free]?
    Does it open where you got it from?
    Peter

  • How can i open encrypted word documents and still be able to edit?

    I need to open encrypted word documents at my work to edit reports which are sensitive in nature, then be able to send them back to colleagues encrypted. I would like to do this all on my iPad. Are there specific apps I can download to be able to do this? Right now I'm using Google Drive for documents online and would like to be able to utilize this.

    You can download these free MS Office apps (Word, Excel, PowerPoint) to view (but not create or edit) these files.
    https://itunes.apple.com/us/app/microsoft-word-for-ipad/id586447913?mt=8
    https://itunes.apple.com/us/app/microsoft-excel-for-ipad/id586683407?mt=8
    https://itunes.apple.com/us/app/microsoft-powerpoint-for-ipad/id586449534?mt=8
    Microsoft Office for iPad:Early Reviews of Word, PowerPoint & Excel Apps
    http://ipadacademy.com/2014/03/microsoft-office-for-ipad-early-reviews-of-the-wo rd-powerpoint-excel-apps
    Not sure if Office 365 has the capability to unencrypt/encrypt word documents.
     Cheers, Tom

  • How can I open a word-document in word?

    I want to have a link in my java-program to a word-document, but I don't know how to open the document in word from java.

    If you are using windows and word is set up as the associated program for doc files, you could use a runtime process to open it. To find the correct syntax, try to open the document through the command line and then use that command.

  • How can Tiger open Microsoft Word documents sent by e-mail?

    I recently upgraded to Tiger and use Appleworks 6, which is unable to read the Microsoft Word documents I frequently receive by e-mail. Is there any way I could read such documents, or should I get Microsoft Word? If so, which number/level would you advise? (I'm happy with Appleworks.)

    Do the problematic Word attachments end in ".doc" or in ".docx"?
    Neither AppleWorks 6 nor TextEdit will handle Microsoft's marketing-driven "improved" file format used in Mac Office 2008 / Windows Office 2007 (which is almost-but-not-really based on XML). There's a backwards-compatible option in those versions of Word to "Save As" Word 97 -2004 format (.doc). The practical solution where I work is to track down anyone sending .docx and threaten them with grievous bodily harm unless they resend as .doc and swear to never use .docx again.
    Microsoft has a converter that (allegedly) converts the new format to the vastly more common one, but that requires a previous copy of Office (Office 2004 or Office X).
    You can try the Mac OS X Dashboard widget DocX Converter instead.

  • How can I open a word document in pages?

    I want to open documents created in Word for Mac in Pages on my iPad.

    I was going to say. “very carefully.” You can drag and drop a compatible file onto the Pages dock icon. Depending on what that MS Word content contains, Pages may pop a warning dialog about the document's contents, and the option to view the associated warnings.

  • After downloading OSX Maverick you then cant use work. excel or powerpoint. What do i use and how can i recall my word documents etc

    After downloading OSX Maverick you then cant use work. excel or powerpoint. What do i use and how can i recall my word documents etc

    Use Office for Mac 2011.  If you have it, open one of the programs (Word, Excel, PowerPoint) and do Help > Check for Updates from the menu.
    Otherwise, purchase Office 365 and use that.

  • How can I save my word documents in ICLOUD

    How can I save my word documents in ICLOUD

    You can't directly, as Microsoft don't include iCloud support in their apps.
    You'd have to open your Word file in Apple's Pages and save it to iCloud from there.

  • How can I open Microsoft Word files on my iMac?

    How can I open Microsoft Word files on my iMac?

    You can even use the Pages app that is installed on your computer. Finally you can buy a license of Office for Mac and have Word, Excel, PowerPoint and if you want Outlook too.

  • How can I attatch a word document to an email that have already been sent to me in another email?, How can I attatch a word document to an email that have already been sent to me in another email?

    How can I attatch a word document to an email that have already been sent to me in another email?,

    Forward the original E-Mail and tap "Include Attachments".

  • Can you open a word document in pages 08

    Quick question however stupid it is
    can you open a word document from a pc in pages 08?
    sorry in advance if i have posted this in the wrong discussion area
    cheers
    Message was edited by: Lama323

    The answer is as above wrote yes. Does it do it perfectly, the answer is no. Opening a .doc/.docx in Pages'08 will generate a frame warning message I find. I find text and symbols are preserved well, but formatting is not perfect. An example of my own is in the screenshot below. Same page 28 on a .docx but formatting of the document is not exactly preserved as you can clearly see. Where preservation of formatting is critical Pages is good, but not perfect alternative to Word '08.
    http://img225.imageshack.us/img225/2461/docxcu2.png

  • I can't open my word documents?

    I can't open my word documents on my mac book pro. neither can I open the icon of W.Who can help?

    Click here and follow the instructions.
    (86677)

  • How can I convert a Word Document to a PDF Document. The word document is already on my Pc

    How can I convert a Word Document already on my PC, to a PDF Document

    Using
    Adobe PDF Pack
    Adobe Acrobat
    Microsoft Word 2007+

  • HT203175 How can I copy my Word document and my films which I already have in my computer into my itouch?

    How can I copy my Word documents and my films which I already have in my computer into my itouch?

    Yes.
    Everything in iCal on the Mac is archived with the Export.
    This is another method for backing up your iCal data. The Address Book includes the same option.

  • How can i open appleworks 6 documents with 10.9.1

    how can i open appleworks 6 documents with 10.9.1

    Hi,
    See A Brody's AppleWorks tip here: https://discussions.apple.com/docs/DOC-2522
    John M

Maybe you are looking for

  • Characteristic values in BAPI_SALESORDER_CHANGE

    Hi, I want to add new configurable item in existing sales order with charactersitic values. Iam using bapi BAPI_SALESORDER_CHANGE. Iam now able to insert configurable item in existing sales order. But the characteristic values are not getting stored.

  • Android Multi-Issue App not loading

    So I finally managed to export a folio through the digitalpublishing portal, and it looks good on Mac with the Adobe Content Viewer and also on the Galaxy Tab with the Content Viewer, now I wanted to export it with the viewer builder programm on my M

  • ITunes stopped working after 8.01 upgrade

    While running iTunes 8 on my xp pro box it asked to upgrade. I said yes. It did, but never appeared after upgrading. It is running in the task manager, but no application ever appears. Here's what I have tried: 1. repair install - no luck 2. remove i

  • Two Clear System Cache Needed in Two Days since 602 Update

    I found out why my battery is worse with the 602 update. Appararently my phone is NEVER GOING TO SLEEP. I forget the name of the service that was keeping it awake. I think it was com.motorola.service.main. After the clear cache, it was good for a day

  • [Solved]Pacman fails to connect to server in Arch Virtual Machine

    Hi I've just installed arch 2008.06 in VMWare Workstation 6.04 on Vista Business x64. The setup all went fine and i am now logged into my system, but Pacman refuses to connect to anything. i have tried Bridged networking and NAT to no avail. whenever