The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 How to add Origin graph to MS Word file?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000