none
Edit image size in table cell of word document RRS feed

  • Question

  • Hi,

    I need to be able to resize an image inside the table cell of word document that was pasted from clipboard. See below code, hope someone can point me in the right direction.

    // Add table 
                        Word.Table _table;
                        Word.Range wrdRng = _document.Bookmarks.get_Item(ref oEndOfDoc).Range;
                        _table = _document.Tables.Add(wrdRng, _trackBar.Maximum , 1, ref oMissing, ref oMissing);
                        _table.AllowAutoFit = false;
                        _table.Rows.Height = 450;
    
                        var colWidth = _table.Columns[1].Width -20;
                                            
                        int index = 0;
                        foreach(Cell _cell in _table.Range.Cells)
                        {
                            
                            _trackBar.Value = index;
                            TrackBar1_Scroll(_trackBar, EventArgs.Empty);
                            _cell.Range.Paste();
                           
                            //Resize picture to fit inside the table cell
                            
    
    
                            _cell.Range.InsertAfter("\nComments: ");
                            _cell.Range.Font.Size = 12;
                            index++;
                        }

    Thanks,


    wesley

    Monday, August 17, 2015 3:48 PM

Answers

All replies

  • Hi wesley,

    I help you to move your question to Word For Developers forum where you can get more help.

    Thanks for your understanding.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, August 18, 2015 5:20 AM
    Moderator
  • I figured it out.

    var shape = _cell.Range.InlineShapes[1];
    shape.Width = 600;


    wesley

    Tuesday, August 18, 2015 2:53 PM