Some Useful code for Excel comment
2007-04-11 12:34
501 查看
1Excel.Range range = oWorkSheet.get_Range("A1",missing);
2
3 Excel.Comment comment = range.AddComment("");
4
5 comment.Shape.Fill.UserPicture(@"d:\\stop.jpg"); //insert the picture
6 comment.Shape.Shadow.Visible = Microsoft.Office.Core.MsoTriState.msoFalse; //set the shadow don't display
7 comment.Shape.ThreeD.Visible = Microsoft.Office.Core.MsoTriState.msoFalse; //set the ThreeD effect don't display
8 comment.Shape.Line.Visible = Microsoft.Office.Core.MsoTriState.msoFalse; //set the line hidden
9 comment.Shape.IncrementLeft((float)-0.75); //set the comment shape position
10 comment.Shape.IncrementTop((float)8.25);
11 comment.Text(" ",missing,missing) ; //repalce the comment text
12 comment.Visible = true;
Insert a pitcture to excel
1pics.Insert(page.Server.MapPath("../../Images/stop.bmp"),Type.Missing);
2 Excel.Range range = oWorkSheet.get_Range("D"+EndIndex,"D"+EndIndex);
3 Excel.Picture pics01 = (Excel.Picture)pics.Item(1);
4 pics01.Top = (double)range.Top;
5 pics01.Left = (double)range.Left;
6 pics01.ShapeRange.PictureFormat.TransparentBackground = Microsoft.Office.Core.MsoTriState.msoTrue;
7 pics01.ShapeRange.PictureFormat.TransparencyColor = 0;
8 pics01.ShapeRange.Fill.Visible = Microsoft.Office.Core.MsoTriState.msoFalse;
From: http://www.codeproject.com/office/office_automation.asp?df=100&forumid=356843&exp=0&select=1815109
2
3 Excel.Comment comment = range.AddComment("");
4
5 comment.Shape.Fill.UserPicture(@"d:\\stop.jpg"); //insert the picture
6 comment.Shape.Shadow.Visible = Microsoft.Office.Core.MsoTriState.msoFalse; //set the shadow don't display
7 comment.Shape.ThreeD.Visible = Microsoft.Office.Core.MsoTriState.msoFalse; //set the ThreeD effect don't display
8 comment.Shape.Line.Visible = Microsoft.Office.Core.MsoTriState.msoFalse; //set the line hidden
9 comment.Shape.IncrementLeft((float)-0.75); //set the comment shape position
10 comment.Shape.IncrementTop((float)8.25);
11 comment.Text(" ",missing,missing) ; //repalce the comment text
12 comment.Visible = true;
Insert a pitcture to excel
1pics.Insert(page.Server.MapPath("../../Images/stop.bmp"),Type.Missing);
2 Excel.Range range = oWorkSheet.get_Range("D"+EndIndex,"D"+EndIndex);
3 Excel.Picture pics01 = (Excel.Picture)pics.Item(1);
4 pics01.Top = (double)range.Top;
5 pics01.Left = (double)range.Left;
6 pics01.ShapeRange.PictureFormat.TransparentBackground = Microsoft.Office.Core.MsoTriState.msoTrue;
7 pics01.ShapeRange.PictureFormat.TransparencyColor = 0;
8 pics01.ShapeRange.Fill.Visible = Microsoft.Office.Core.MsoTriState.msoFalse;
From: http://www.codeproject.com/office/office_automation.asp?df=100&forumid=356843&exp=0&select=1815109
相关文章推荐
- Here are some useful hints for reduce your C/C++ code dramatically
- Some handy code for backing beans ( ADF & JSF )
- 【软件自动化测试-QTP实战技能 11】== QTP code for excel link
- Some useful link for Serial Listen and Forward
- Some useful tricks for Virtual (and normal) hosts in Apache’s httpd.conf
- 25+ Useful Selenium Web driver Code Snippets For GUI Testing Automation
- 【DataStructure】Some useful methods for arrays
- some useful links for tivoli
- 20 very useful Java code snippets for Java Develop
- some useful command for openSuse
- Some weird but useful C code
- Some useful Regular Expression for Web UI Validation
- Some useful info for rebuilding database
- Some handy code for backing beans ( ADF & JSF )
- some useful code
- [Javascript] Some very simple functions for Word and Excel handling
- Some useful environment for u-boot
- 【DataStructure】Some useful methods for arrays
- Some useful tools for the Web Developer
- Some Useful resources for ArcGIS and Flex