| T O P I C    R E V I E W | 
               
              
                | hkkim | 
                Posted - 09/17/2012 : 04:02:12 AM  Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 8.1 SR3 Operating System: Windows XP
  I'm a novice in Origin C. I want to make an automation of many graph generation using LabTalk and Origin C. At first I wanted to make this work with LabTalk only. But there are so many graphs that  I want to divide them into several MS Word files. I attached the modifed sample program,  \\Samples\COM Clients\MS Office\ReportCreation.c below. The CreateReportDoc() will be called several times. I want to add all graphs(excluding embedded graphs) in my current Origin project to a MS Word file. I don't know the exact command to add a graph(**) and skip a embedded graph(*). Could you show me the way ?
  --------------------------------------------------------------------- void CreateReportDoc() { 	// Create a Word application object and set as invisible 	Object oWord, oWordDoc; 	oWord = CreateObject("word.application"); 	//oWord.Visible = false; 	oWord.Visible = true;
  	// Loop over all graphs in project 	foreach(GraphPage grPg in Project.GraphPages) 	{ 		//* Skip over any embedded graphs or Layout windows     // LabTalk scripts: if(page.IsEmbedded==0&&exist(%H)!=11)     // <== How to add here? 		out_str(grPg.GetName()); // output graph name 		 		// Add a new document to the Word application 		oWordDoc = oWord.Documents.Add(); 	 		// Insert graph into Word document 		// ** how to add graph to MS Word file 		oWordDoc.Add(grPg); // <== How to fix here? 	}	 	 	// Save the Word document 	string strFldPath="D:\Study\Test\RunTest"; 	oWordDoc.SaveAs(FileName := strFldPath + "CreateReport" + ".doc"); 	printf("Report saved as %s\n",strFldPath + "CreateReport" + ".doc"); 	 	// Close the Word applications 	oWord.Quit(); 	printf("Done!\n"); }
  | 
               
              
                | 1   L A T E S T    R E P L I E S    (Newest First) | 
               
              
                | Penn | 
                Posted - 09/18/2012 : 01:47:52 AM  Hi,
  As you can see the example provided by Origin (ReportCreation.c), the graph in Origin will be exported as image of bmp format, and then add to Word. Maybe you can try this method first.
  About skipping the embedded graph, please refer to GetEmbeddingInfo method.
  Penn | 
               
             
           | 
         
       
       
     |