Quantcast
Channel: Word for Developers forum
Viewing all articles
Browse latest Browse all 4350

Graph in Word - how to set vertical axis title?

$
0
0

Hi,

This is how I add a chart into Word - it's working - I just want to find out how to set the Y-axis title to for example "Dollar Amount":

            object missing = Type.Missing;
            Word.Application application = new Microsoft.Office.Interop.Word.Application();
            application.Visible = true;
            Word.Document document = application.Documents.Add();
            object classtype = "Excel.Chart.8";
            object oEndOfDoc = "\\endofdoc";
            Word.InlineShape wrdInlineShape = document.InlineShapes.AddOLEObject(classtype);
            object verb = Word.WdOLEVerb.wdOLEVerbHide;
            wrdInlineShape.OLEFormat.DoVerb(ref verb);
            Random rn = new Random();
            Excel.Workbook workBook = (Excel.Workbook)wrdInlineShape.OLEFormat.Object;
            Excel.Worksheet workSheet = (Excel.Worksheet)workBook.Worksheets["Sheet1"];
            wrdInlineShape.Width = 400;
            workBook.ActiveChart.ChartType = Excel.XlChartType.xlLine;
            workBook.ActiveChart.HasTitle = true;
            workBook.ActiveChart.ChartTitle.Text = "My chart title";
            wrdInlineShape.ConvertToShape();



Viewing all articles
Browse latest Browse all 4350

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>