Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

insert graph into word document

I have a graph that i would like to programmatically insert into a word document.  I am using C#.  right now i have the document being populated with information about the graph but now i would like the graph to be inserted.  is there an easy way to do this?
0 Kudos
Message 1 of 2
(3,631 Views)
Hi Layzie292,

first you will have to save the control to an image, and then you can place the image in Word.  To create the image, use:
WaveformGraph1.ToFile("<path here>", ImageType.Jpep);

You should then be able to place it into the word document using:
wordDoc.InlineShapes.AddPicture("<pic path here>", ref object LinkToFile, ref object SaveWithDocument, ref object Range);

Let me know if you have any further questions!

NickB
0 Kudos
Message 2 of 2
(3,620 Views)