How to copy master spread from one document to other

I've used kNewMasterSpreadCmdBoss command and IMasterSpreadCmdData interface but it copies master spread with empty master page.
Should I setup some additional parameters for command? Or should I use different mechanism?

Try,
// dstDoc must be FrontDocument
InterfacePtr<ILayoutControlData> layoutData(Utils<ILayoutUIUtils>()->QueryFrontLayoutData());
InterfacePtr<ICommand> createMasterFromMasterCmd(CmdUtils::CreateCommand(kCreateMasterFromMasterCmdBoss));
createMasterFromMasterCmd->SetItemList(UIDList(srcMasterSpreadUIDRef));
InterfacePtr<ILayoutCmdData> layoutCmdData(createMasterFromMasterCmd, UseDefaultIID());
layoutCmdData->Set(::GetUIDRef(layoutData->GetDocument()), layoutData);
CmdUtils::ProcessCommand(createMasterFromMasterCmd);

Similar Messages

  • How to copy-paste frames from one document to other with there respective layers intact?

    Hi All,
         I am facing an issue while copy paste frames from one document to other. I have a 3 frames in first documents each one on different layer. First document has 3 layers. The second document too have 3 layers , I am copying frames from first document to scrapdata using 'ICopyCmdData ' and 'kCopyCmdBoss'. I have 'Paste Remembers Layers' menu 'Checked' on Layer panel. I am using following function to copy frames to scrapdata.
    bool16 copyStencilsFromTheTemplateDocumentIntoScrapData(PMString & templateFilePath)
         bool16 result = kFalse;
        do
            SDKLayoutHelper sdklhelp;
            PMString filePathItemsToBeCopiedFrom(templateFilePath);  //("c:\\test\\aa.indt");
            IDFile templateIDFile(filePathItemsToBeCopiedFrom);
            UIDRef templateDocUIDRef = sdklhelp.OpenDocument(templateIDFile);
            if(templateDocUIDRef == UIDRef ::gNull)                 
                break;
            ErrorCode err = sdklhelp.OpenLayoutWindow(templateDocUIDRef);
            if(err == kFailure)                 
                break;
            InterfacePtr<IDocument> templatedoc(templateDocUIDRef,UseDefaultIID());
            if(templatedoc == nil)               
                break;
            InterfacePtr<ISpreadList>templateSpreadUIDList(templatedoc,UseDefaultIID());
            if(templateSpreadUIDList == nil)                  
                break;
            IDataBase * templateDocDatabase = templateDocUIDRef.GetDataBase();
            if(templateDocDatabase == nil)                  
                break;
            UIDRef templateDocFirstSpreadUIDRef(templateDocDatabase, templateSpreadUIDList->GetNthSpreadUID(0));
            InterfacePtr<ISpread> templateSpread(templateDocFirstSpreadUIDRef, IID_ISPREAD);
            if(templateSpread == nil)                 
                break;
            UIDList templateFrameUIDList(templateDocDatabase);
            if(templateSpread->GetNthPageUID(0)== kInvalidUID)                  
                break;      
            templateSpread->GetItemsOnPage(0,&templateFrameUIDList,kFalse,kTrue);  
            InterfacePtr<ICommand> copyStencilsCMD(CmdUtils::CreateCommand(kCopyCmdBoss));
            if(copyStencilsCMD == nil)                
                break;
            InterfacePtr<ICopyCmdData> cmdData(copyStencilsCMD, IID_ICOPYCMDDATA);
            if(cmdData == nil)                 
                break;
            // Copy cmd will own this list
            UIDList* listCopy = new UIDList(templateFrameUIDList);
            InterfacePtr<IClipboardController> clipboardController(gSession,UseDefaultIID());
            if(clipboardController == nil)              
                break;
            ErrorCode status = clipboardController->PrepareForCopy();
            if(status == kFailure)                  
                break;
            InterfacePtr<IDataExchangeHandler> scrapHandler(clipboardController->QueryHandler(kPageItemFlavor));
            if(scrapHandler == nil)                 
                break;
            clipboardController->SetActiveScrapHandler(scrapHandler);
            InterfacePtr<IPageItemScrapData> scrapData(scrapHandler, UseDefaultIID());
            if(scrapData== nil)                
                break;
            UIDRef parent = scrapData->GetRootNode();
            cmdData->Set(copyStencilsCMD, listCopy, parent, scrapHandler);
            if(templateFrameUIDList.Length() == 0)       
                return kFalse;      
            else      
                status = CmdUtils::ProcessCommand(copyStencilsCMD);    
            if(status != kFailure)
              result = kTrue;
            sdklhelp.CloseDocument(templateDocUIDRef,kFalse,K2::kSuppressUI, kFalse);
        }while(kFalse);
        return result;
    After this I need to close first document. Now I am opening the second document from indt file which has same number of layers as first document. I am trying to paste frames from scrap data to second document using '' 'ICopyCmdData ' and 'kPasteCmdBoss' as shown in follwoing function
    bool16 pasteTheItemsFromScrapDataOntoOpenDocument(UIDRef &documentDocUIDRef )
        bool16 result = kFalse;
        do
               InterfacePtr<IClipboardController> clipboardController(gSession,UseDefaultIID());
                if(clipboardController == nil)
                    break;
               InterfacePtr<IDataExchangeHandler> scrapHandler(clipboardController->QueryHandler(kPageItemFlavor));
               if(scrapHandler == nil)               
                    break;
               InterfacePtr<IPageItemScrapData> scrapData(scrapHandler, UseDefaultIID());
                if(scrapData == nil)
                   break;
                     //This will give the list of items present on the scrap
                UIDList* scrapContents = scrapData->CreateUIDList();
                if (scrapContents->Length() >= 1)
                    InterfacePtr<IDocument> dataToBeSprayedDocument(documentDocUIDRef,UseDefaultIID());
                    if(dataToBeSprayedDocument == nil)
                       break;
                    InterfacePtr<ISpreadList>dataToBeSprayedDocumentSpreadList(dataToBeSprayedDocument,UseDef aultIID());
                    if(dataToBeSprayedDocumentSpreadList == nil)
                         break;
                    IDataBase * dataToBeSprayedDocDatabase = documentDocUIDRef.GetDataBase();
                    if(dataToBeSprayedDocDatabase == nil)
                         break;    
                    UIDRef spreadUIDRef(dataToBeSprayedDocDatabase, dataToBeSprayedDocumentSpreadList->GetNthSpreadUID(0));               
                    SDKLayoutHelper sdklhelp;
                    UIDRef parentLayerUIDRef = sdklhelp.GetSpreadLayerRef(spreadUIDRef);
                    InterfacePtr<IPageItemScrapData> localScrapData(scrapHandler, UseDefaultIID());
                    if(localScrapData == nil)
                        break;
                    if(parentLayerUIDRef.GetUID() == kInvalidUID)
                        break;
                    InterfacePtr<ICommand> pasteToClipBoardCMD (CmdUtils::CreateCommand(kPasteCmdBoss));
                    if(pasteToClipBoardCMD == nil)
                        break;
                    InterfacePtr<ICopyCmdData> cmdData(pasteToClipBoardCMD, UseDefaultIID());
                    if(cmdData == nil)
                        break;
                    if(scrapContents == nil)
                        break;               
                    PMPoint offset(0.0, 0.0);
                    cmdData->SetOffset(offset);
                    cmdData->Set(pasteToClipBoardCMD, scrapContents, parentLayerUIDRef );
                    ErrorCode status = CmdUtils::ProcessCommand(pasteToClipBoardCMD);
                    if(status == kSuccess)
                        CA("result = kTrue");
                        result = kTrue;
                }//end if (scrapContents->Length() >= 1)       
        }while(kFalse);
        return result;
         Here in above function its required to set Parent Layer UIDRef and because of this all frames are getting paste in one layer.
    Is there any way we can paste frame in there respective layers?
         Also I need to work this code with CS4 server and desktop indesign.
    Thanks in advance,
    Rahul Dalvi

    Try,
    // dstDoc must be FrontDocument
    InterfacePtr<ILayoutControlData> layoutData(Utils<ILayoutUIUtils>()->QueryFrontLayoutData());
    InterfacePtr<ICommand> createMasterFromMasterCmd(CmdUtils::CreateCommand(kCreateMasterFromMasterCmdBoss));
    createMasterFromMasterCmd->SetItemList(UIDList(srcMasterSpreadUIDRef));
    InterfacePtr<ILayoutCmdData> layoutCmdData(createMasterFromMasterCmd, UseDefaultIID());
    layoutCmdData->Set(::GetUIDRef(layoutData->GetDocument()), layoutData);
    CmdUtils::ProcessCommand(createMasterFromMasterCmd);

  • How to copy a folder from one document library to another document library ?

    How to copy a folder from one document library to another document library by programmtically?
    Samarendra Swain
    Team Sharepoint
    www.manuhsolutions.com

    You can use the SPFolder.CopyTo method.
    public static void CopyFolder()
    SPFolder folder = null;
    using (SPSite site = new SPSite("http://basesmcdev2/sites/tester1"))
    using (SPWeb web = site.OpenWeb())
    folder = web.GetFolder("shared%20documents/newfolder");
    folder.CopyTo("tester4/newfolder");
    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfolder.copyto.aspx
    certdev.com

  • How to copy the variants from one user to other user?

    Hi all,
    I have a list of variants(nearly 10 variants) for a report named 'ZONEORDER'. I need to copy all the variants to another user. Is it possible?
    If so, could anyone suggest the solution?
    Thanks in advance.
    Regards,
    Vijay.

    Hello Vijay,
    I need to copy all the variants to another user.
    What does " copy to another user" mean?
    You can attach the variant to a Transport through prog. RSTRANSP and move to subsequent systems.
    BR,
    Suhas

  • Copy single master page from one document to another?

    The answer to a previously posted question seems to involve creating a document differently (than I had). A lot of work went into the creation of the master pages in the original document which I will now need to recreate in the new document. Is there a way I can copy one master page from one document to another?
    Many thanks,
    Theresa

    There are a number of ways to do this.
    Create a copy of the document you want to copy the Master page from. Delete all pages except for the one you want (but you have to leave Right and Left alone as FM must always have these two pages available).
    Open the new document and the one that you want to import the master pages from.
    In the new document:
    Import from Document: (select the document with the Master Page that you want)
    then
    File > Import > Formats
    and select Page Layouts only.
    Note that Right/Left always come along for the ride.
    Alternative and probably best way to get a single Master Page:
    In new document, add a new Master Page and select "Empty".
    In the old document, on the desired Master Page, Select All on page (ctrl+A) and then copy (ctrl+v).
    In the new document on the new master page, paste (ctrl+v) to add the layout. Note: you may need to rotate the page first  if it isn't in the same orientation as in the old document.

  • How to copy a node from one dom document to another?

    I have one dom document that I have to split up into multiple dom documents. I am able to get the inividual nodes that I want to put into seperate documents.
    My problem occurs when I create a new dom document and try to add the node from the parent document. I get an exception saying (copied from api: WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. )
    How can I make it so that I can copy a node from one document and add it to another.

    Have you checked out the API called importNode in the DOM Document. It lets you move nodes between different documents.
    This api lets you simply copy the existing node from one document into another. without creating any new nodes for it.
    I have done a small example please have a look.
    Book.xml
    <?xml version="1.0"?>
    <books>
      <book>
        <name>Inside Corba</name>
      </book>
      <book>
        <name>Inside RMI</name>
      </book>
    </books>------------------------
    Book2.xml
    <?xml version="1.0"?>
    <books>
      <book>
        <name>Core Java </name>
      </book>
      <book>
        <name>Core JINI</name>
      </book>
    </books>-------------------
    MoveNode.java (copies nodes from doc2 into doc1)
    import java.io.*;
    import javax.xml.parsers.*;
    // structures
    import org.w3c.dom.*;
    import org.xml.sax.*;
    public class MoveNode
      public static void main(String[] args)
        // step1. create a factory and configure it
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        // step2. set various configurations
        factory.setValidating(false); // do not need validation at this time.
        factory.setIgnoringComments(false); // do not ignore comments
        factory.setIgnoringElementContentWhitespace(false); // do not ignore element content whitespace.
        factory.setCoalescing(false);
        factory.setExpandEntityReferences(true);
        // step 3 create a document builder
        DocumentBuilder builder = null;
        try
          builder = factory.newDocumentBuilder();
        catch(ParserConfigurationException e)
          e.printStackTrace();
        try
          Document doc1 = builder.parse(new File("book.xml"));
          Document doc2 = builder.parse(new File("book2.xml"));
          if (doc1 == null || doc2 == null)
            System.out.println("doc1 is null or doc2 is null");
            System.exit(1);
          } // if
          // fetch books from doc2
          NodeList list = doc2.getElementsByTagName("book");
          System.out.println("number of books found " + list.getLength());
          Node node1 = list.item(0);
          Node node2 = list.item(1);
          // get the root node of doc1
          Node root = (Node) doc1.getDocumentElement();
          root.appendChild(doc1.importNode(node1, false));
          root.appendChild(doc1.importNode(node2, false));
          //now doc1 should have 4 nodes
          System.out.println(doc1.getElementsByTagName("book").getLength());
        } // try
        catch(SAXException se)
          se.printStackTrace();
        catch(IOException ie)
          ie.printStackTrace();
    hope this helps.
    regards,
    Abhishek.

  • Copy/Move Layerset From One Document To Another Without Flattening

    Hello,
    Does anyone know how to move a layerset from one document to another using JavaScript ExtendScript, but without having to flatten the layers first as I still need to edit them after the move.
    Many Thanks,
    James

    This requires that you have the the two documents open the first document open is the one you are copying from with the layer/layers selected.
    activeDocument=documents[0];
    dupLayers();
    function dupLayers() {
        var desc15 = new ActionDescriptor();
            var ref12 = new ActionReference();
            ref12.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
        desc15.putReference( charIDToTypeID('null'), ref12 );
            var ref13 = new ActionReference();
            ref13.putName( charIDToTypeID('Dcmn'), documents[1].name );
        desc15.putReference( charIDToTypeID('T   '), ref13 );
        desc15.putInteger( charIDToTypeID('Vrsn'), 2 );
        executeAction( charIDToTypeID('Dplc'), desc15, DialogModes.NO );

  • How to copy OVD configuration from one machine to another?

    We have two machines with OVD servers on them. The configurations should be identical from one machine to the other. We suspect there is a problem with the configuration on one of them. We need to know how to copy OVD configuration from one machine to another.
    Can you tell us how to do that?

    well i have this in mind which may help you.
    You would need to have a public ip address to the machine you have consoled to and on internet.
    Download the tftp software from below link.
    http://tftpd32.jounin.net/
    This software does not only act as the tftp server but also you can select the interface of you ethernet card as tftp server ip address.
    For ex if you are connected to a console and have a wireless card which is connected to internet also you connect you eth lan card to the eth or fast eth of the router.
    you can select which ever interface you want to act as the tftp server.
    you will need to add ip addres for you lan card and also config the router port as same if needed.

  • Copy a page from one Document to another

    Can anyone help
    In Pages '08 we had the ability to copy a page from one document to another.
    In Pages '09 this does not seem possible.
    Does anyone have anwser....
    Thanks
    Message was edited by: AJCUR
    OK my bad
    I just realized that I was in Word Processing in one document and Page Layout in another and you cannot do the copy between the two. Changed the Blank documentto word processing and voila it worked.

    I think this might help. Go to the document you want to copy the page from and go to the "View" menu and choose "page thumbnail" so you can see the thumbnails on the side of the document. Right click (or control click) on the thumbnail of the page you want to copy and choose "copy.
    Go to the document you want to paste the page into and make sure you have the "View thumbnail" option turned on. If you already have some pages click on the page you want the new page to follow and then right click and paste the page where you want it. (you have to do this in the thumbnail view area, not in the actual document itself.) If you have inserted the page in the wrong spot, just drag it to the right location. note: I have tried dragging the thumbnail from one document to another and it does not work. Too bad because it works that way with a PDF documents in "Preview" app.

  • How to copy List item from one list to another using SPD workflow using HTTP call web service

    Hi,
    How to copy List item from one list to another using SPD workflow using HTTP call web service.
    Both the Lists are in different Web applications.
    Regards, Shreyas R S

    Hi Shreyas,
    From your post, it seems that you are using SharePoint 2013 workflow platform in SPD.
    If that is the case, we can use Call HTTP web service action to get the item data, but we cannot use Call HTTP web service to create a new item in the list in another web application with these data.
    As my test, we would get Unauthorized error when using Call HTTP web service action to create a new item in a list in another web application.
    So I recommend to achieve this goal programmatically.
    More references:
    https://msdn.microsoft.com/en-us/library/office/jj164022.aspx
    https://msdn.microsoft.com/en-us/library/office/dn292552.aspx?f=255&MSPPError=-2147217396
    Thanks,
    Victoria
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • HOW TO COPY A FORM FROM ONE TO ANOTHER CLIENT

    HOW TO COPY A FORM FROM ONE TO ANOTHER CLIENT

    Hi Tina,
    To copy either a Script or a Smartform fron one client to another client i.e from reference client 000 to any client say 010  follow instructions as given below:
    Go to Tcode SE71->Give Form name MEDRUCK then go to Menu path Utilities->Copy From Client, give
    Form Name: MEDRUCK
    SOURCE:000 (it will be already there)
    Target Form: Zmedruck(here give ur form zname)
    Execute
    It will be copied into all languages.
    Then come back to SE71
    Give your form name Zmedruck
    Language:: de then goto change mode
    then menu path->utilities->convert original languge to En and enter you will get a message original language of form zmedruck converted from de to en,
    now  change language de to en in se71 main screen and then do what ever changes you want to do , this is how you can copy a script or smartform from one client to another client.
    If this answer is useful reward points any queries revert me back.

  • How to move BCS data from one box to other

    Hello Expert,
    Dose any one know how to move BCS data from one box to other box ?
    Thanks & Regards,

    1) The best is to do the test. In my case, my customer was just doing this transfer (in full) to perform tests on the BEX reportings. Actually, they never raised any issue regarding document number when they did additional postings in test system... I would also say that during the transfer, the number counter in Qual gets not synchronized with the one in Prod. So, I think the system will just take the next number available in Qual. Should not be an issue.
    2)  As explained in answer 1), in my case, the purpose was not to perform data migration from one system to the other one. Thus, my customer never performed a subsequent consolidation in the target system. But, basically, the transfer copies all data : posting levels 00 to 30, for all periods you have selected + Additional financial data and sequence of activities. Thus, for me, everyhting is available in the target system, including COI documents. In other words, the "picture" regarding the data should be exactly the same between both system. The only thing you need to pay attention to is the customizing : it must be the same in Qual and Prod (example : date of acquisition and divestiture, structure of the group, etc...).
    Another very important thing, is that your export data source must not be enriched due to the BCS Delta load scenario. If it is the case, the system will write the consolidation logic (i-e the consolidation group + reporting mode) when transferring the data from the source Real Time Infocube to the Target Real time infocube, which will lead to inconsistent data in the target system.

  • Hi,how can i transport objects from one server to other like (Dev To Qty)

    Hi Sir/madam,
       Can u explain how can i transport objects from one server to other like (Development To Quality To Production).
    Regards,
    Vishali.

    Hi Vishali,
    Step 1: Collect all Transports(with Packages) in Transports Tab(RSA1)- CTO
    Step 2: Release the subrequests first and then the main request by pressing Truck button
    Step 3: STMS or Customized transactions
    Object Collection In Transports:
    The respective Transports should have the following objects:
    1. Base Objects -
    a. Info Area
    b. Info object catalogs
    c. Info Objects
    2. Info Providers u2013
    a. Info Cubes
    b. Multi Providers
    c. Info Sets
    d. Data Store Objects
    e. Info Cube Aggregates
    3. Transfer Rules u2013
    a. Application Components
    b. Communication Structure
    c. Data Source replica
    d. Info Packages
    e. Transfer Rules
    f. Transformations
    g. Info Source Transaction data
    h. Transfer Structure
    i. Data sources (Active version)
    j. Routines & BW Formulas used in the Transfer routines
    k. Extract Structures
    l. (Note) If the transfer structures and related objects are being transferred without preceding
    Base Objects transport (e.g. while fixing an error) it is safer to transport the related Info
    Objects as well.
    4. Update Rules u2013
    a. Update rules
    b. Routines and formulas used in Update rules
    c. DTPs
    5. Process Chains u2013
    a. Process Chains
    b. Process Chain Starter
    c. Process Variants
    d. Event u2013 Administration Chains
    6. Report Objects u2013
    a. Reports
    b. Report Objects
    c. Web Templates
    Regards,
    Suman

  • How to read a table from one host to other host

    Hi Everybody,
    How to read a table from one host to other host.
    For Example,
    a/a@abcd - host 1
    b/b@xyz - host 2
    suppose im having a table called emp in a/a@abcd
    i want to read the table emp in b/b@xyz
    how to do this.??
    I know that we have to create a dblink...after that how to proceed.
    Plz help..
    Thanks in Advance,
    Gita

    connected as scott/tiger@test
    SQL>
    CREATE DATABASE LINK local
    CONNECT TO admin IDENTIFIED BY pinnet
    USING 'pinnet';
    Database link created.
    sql>
    select count(*) from
    users@local;
    COUNT(*) 
    16
    Message was edited by:
            jeneesh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to make data flow from one application to other in BPEL.

    Hi All,
    I am designing work-flow of my application through BPEL(JDeveloper), I am making different BPEL projects for different functions, like sales manager got the order from sales person and sales manager either approve it or reject it, if he approve it it goes to Production manager and he ships the goods, now I want to keep sales person, sales manger,production manager in seperate BPEL files and want to get the output of sales person to sales manager and sales manager to production manager please help me in dong this.
    I was trying to make partner link in Sales manager of sales person and getting the input from there. I dont know this is right even or not, if it is right I dont know how to make data flow from one application to other.
    Experience people please guide.
    Sales Person -----> Sales Manager ----> Production Manager
    Thanks
    Yatan

    Yes you can do this.
    If you each integration point to be in different process, you have to create three BPEL process.
    1. Create a Async BPEL process 'A' which will be initiated when sales person creates the order.
    2. From BPEL process 'A' call a ASync BPEL process 'B' which has the approval flow. Depending on the input from process 'A' the sales manager will review the order in workflow and approve or reject and send the result back to process 'A'.
    3. Based on the result from workflow, invoke the Sync BPEL process 'C', where you can implement the shipping logic.
    -Ramana.

Maybe you are looking for

  • DVI to S-video connector?

    I'm looking at buying a cable to extend my display onto a TV. Apple sells the mini-DVI to S-video/Composite adapter but doesn't say if it works for the Powerbook G4 15". I would assume that if it works for the 12" it would also work for the 15" and 1

  • How to resolve some install problems for 7.02 on Windows 7 64 bit

    This is a short re-cap of some of the issues I came across when installing NSP 7.02 on Win 7 system. I'm posting it here rather than writing a blog - there are numerous excellent guides already out there, but the particular issues below meant I had t

  • Urgent need of help with a chat application!

    Hi, I'm writing a Chat Application and I want to add Emoticon, I did so by adding buttons but I don't know how to send the gif to my JTextField and to my JTextArea. Here is part of my code can someone can help me PLEASE!!! JPanel chatPane = new JPane

  • Warning msg at the time of PR creation

    When I am creating the PR a Warning msg is being displayed as:- "Base unit of measure KG adopted from  material master record" Could anybody suggest me, why this msg is comming. and if I ignore it and go ahead with pressing enter, Is there any future

  • Logical Column based on expression leads to nQSError: 14020

    Hallo everbody, I've got two dimensions D01, D02 and a fact table F. In Answers I have created analysises before containing D01.A and D02.A without problems. Now, in the rpd-file, I added another logical column to dimension D01, say D01.B, which is b