locked
word document import issue with outline RRS feed

  • Question

  • I am importing the file from my local system to the server .In my local office 2010 is installed.When i am importing the word document which contains outline level,displaying all the level.But same document if i am importing to the server where office 2003 is installed only one level is getting display remaining level is not getting display in my application .For Importinf the file m uploading the file after upload the file,it will be save in the server(if i m uploading to the server) in a particular location in the form of array of bytes after saving m opening the file like this

     

    pWordApp->put_Visible( false );
     SAFE_CALL( pWordApp->get_Documents(&pDocs) );
     SAFE_CALL( pDocs->Open(  &vtFilePath,
            &vOpt,
            &vOpt,
            &vOpt,
            &vOpt,
            &vOpt,
            &vOpt,
            &vOpt,
            &vOpt,
            &vOpt,
            &vOpt,
            &vOpt,
            &pDoc
            ) );
    #endif
     Word::WindowPtr pWindow    = NULL;
     Word::PanePtr pPane    = NULL;
     Word::ViewPtr pView    = NULL;
     Word::WdSpecialPane enSpecialPane;

        pDoc->get_ActiveWindow( &pWindow );
     pWindow->get_View( &pView );
     pView->get_SplitSpecial( &enSpecialPane );

     if( enSpecialPane == Word::wdPaneNone )
     {
      pWindow->get_ActivePane( &pPane );
      pPane->get_View( &pView );
     }
     
     pView->put_Type( Word::wdNormalView );

     pDoc->get_Paragraphs( &pParas ); 
     long lParasCount;
     pParas->get_Count( &lParasCount );
    pWordApp->put_Visible( false );
     SAFE_CALL( pWordApp->get_Documents(&pDocs) );
     SAFE_CALL( pDocs->Open(  &vtFilePath,
            &vOpt,
            &vOpt,
            &vOpt,
            &vOpt,
            &vOpt,
            &vOpt,
            &vOpt,
            &vOpt,
            &vOpt,
            &vOpt,
            &vOpt,
            &pDoc
            ) );
    #endif
     Word::WindowPtr pWindow    = NULL;
     Word::PanePtr pPane    = NULL;
     Word::ViewPtr pView    = NULL;
     Word::WdSpecialPane enSpecialPane;

        pDoc->get_ActiveWindow( &pWindow );
     pWindow->get_View( &pView );
     pView->get_SplitSpecial( &enSpecialPane );

     if( enSpecialPane == Word::wdPaneNone )
     {
      pWindow->get_ActivePane( &pPane );
      pPane->get_View( &pView );
     }
     
     pView->put_Type( Word::wdNormalView );

     pDoc->get_Paragraphs( &pParas );
     long lParasCount;
     
     pParas->get_Count( &lParasCount );
     
     PDOCUMENTLEVEL pDocLevel = new DOCUMENTLEVEL[MAX_LEVEL_COUNT];

     COrchString      osTitle;
     COrchString      osNodeDescription;
     enum Word::WdOutlineLevel  enLevel;
     long       lParaIndex = 1;

     short nDocType  = 1;  // Whether the document being imported is generated from Orchestra
             // This is to trim the autotext, while importing Worddocument, which is exported
             // from Orchestra
             // Added on 08/08/2002 by Arun Devadiga

     NODEDETAILS stNodeDetails;
     
     stNodeDetails.lProjId   = pIWordContext->lProjId;
     stNodeDetails.lStructId   = pIWordContext->lStructId;
     pDocLevel[0].lNodeId   = stNodeDetails.lParentNodeId  
             = pIWordContext->lParentNodeId;
     stNodeDetails.lDerrived   = lDerived;
     stNodeDetails.lRelation    = OrchChild;
     stNodeDetails.lSysType     = lSysType;
     stNodeDetails.osEmailId      = pIWordContext->osEmailId;
     stNodeDetails.osSplitChar      = _T( "Å" );
     stNodeDetails.vtConnString      = *pIWordContext->vtConnString; 
     PDOCUMENTLEVEL pDocLevel = new DOCUMENTLEVEL[MAX_LEVEL_COUNT];

     COrchString      osTitle;
     COrchString      osNodeDescription;
     enum Word::WdOutlineLevel  enLevel;
     long       lParaIndex = 1;

     short nDocType  = 1;  

     NODEDETAILS stNodeDetails;
     
     stNodeDetails.lProjId   = pIWordContext->lProjId;
     stNodeDetails.lStructId   = pIWordContext->lStructId;
     pDocLevel[0].lNodeId   = stNodeDetails.lParentNodeId  
             = pIWordContext->lParentNodeId;
     stNodeDetails.lDerrived   = lDerived;
     stNodeDetails.lRelation    = OrchChild;
     stNodeDetails.lSysType     = lSysType;
     stNodeDetails.osEmailId      = pIWordContext->osEmailId;
     stNodeDetails.osSplitChar      = _T( "Å" );
     stNodeDetails.vtConnString      = *pIWordContext->vtConnString; 

     

    after this m again calling a function which will read the next node..I am suspecting these two place which i made bold font but dont know exactly where it is failing.

    if i am opening the file in my local where office 2010 is installed the value of get_count() is returning 6 which is correct case but in case of server where office 2003 is installed the get_Count() is returning 43 for the same file.

    This is the issue with all the file where outline is defined.this is the problem with the server only all computer is working fine since all comp is having office 2010.Yes my computer is connected to LAN.The level is like this

    + Orchestra

            .Email

            .Meeting

            .Form

            .Document

    _

    in server only "Orchestra." is getting display not all the level.but in case of my local machine it is displaying all the level in the order.I am unable to find out the problem,how to solve this problem.

    Thursday, October 25, 2012 5:03 AM

All replies

  • Hi Manish,

    Please paste the full sample code or upload it to a link.  This code should compile and replicate your issue.  Otherwise it will be difficult to understand what's going on in the code

    Regards,

    yet


    yet

    Monday, October 29, 2012 10:03 PM
  • Hi Manish,

    Does this issue have anything to take with upload code?

    If you copy the same file from Word 2010 machine to Word 2003 machine manually, does it open correctly?

     

    Thanks,


    Shiv Khare

    Wednesday, November 7, 2012 9:31 PM