图文混排,下面两种形式,图片居中就好,并且如果size超过A4页面的话自动缩小为合适尺寸1)图文均换行
文字
图片
文字
图片
文字2)图文均不换行
文字 图片 文字 图片 文字
文字
图片
文字
图片
文字2)图文均不换行
文字 图片 文字 图片 文字
解决方案 »
- 请问各位如何把 picturebox 的外形设置成六角形呢?急求!
- 为什么sina的cookie不完整
- 怎么在WINFORM的DATAGRIDVIEW某格显示GIF动画?
- <%=%>变量怎么赋值
- c# 调用VCDLL的结构数组问题
- 有谁帮我解决这个问题,我再给200分
- vs2005的asp.net中怎么使用动态的水晶报表?
- 在sqldataadapter里运行存储过程,怎样传入参数?
- webform中,关于继承DataGid的问题
- 关于用C#对ACCESS数据库进行修改问题
- winform 实现网页抓取功能!求思路,有源码更好!!分不够另开贴
- VS2008的工具箱是怎么回事??为什么打开sample工具箱有控件,自己新建项目就找不到这些控件?
object oEndOfDoc = "\\endofdoc"; /* \endofdoc is a predefined book */
object name= "d:\\myfile.doc";
object Range=System.Reflection.Missing.Value; //Start Word and create a new document.
Word.Application oWord;
Word.Document oDoc;
oWord = new Word.ApplicationClass();
oWord.Visible = true;
oDoc = oWord.Documents.Add(ref oMissing, ref oMissing,ref oMissing, ref oMissing);
oWord.Selection.Font.Bold = 1;
oWord.Selection.Font.Size=18;
oWord.Selection.ParagraphFormat.Alignment =Word.WdParagraphAlignment.wdAlignParagraphCenter;
oWord.Selection.InlineShapes.AddPicture("e:/picture/123.jpg",ref oMissing,ref oMissing,ref Range);http://topic.csdn.net/t/20060408/12/4672092.html
谢谢,插入图片我是会做的。无法解决的问题是图文混排
public void InsertImage2(string imageFile)
{
object Range = System.Reflection.Missing.Value; wdDoc.Paragraphs.Last.Range.Text = "text1";
wdDoc.Paragraphs.Add(ref Nothing);
wdDoc.Paragraphs.Last.Range.Text = "text2"; //Start Word and create a new document.
wdApp.Selection.Font.Bold = 1;
wdApp.Selection.Font.Size = 18;
wdApp.Selection.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphCenter;
wdApp.Selection.InlineShapes.AddPicture(imageFile , ref Nothing , ref Nothing , ref Range); }
以上代码我预期的效果是:text1
text2
图片结果输出以后变成图片
text1
text2即图片定位问题,求教
然后word类中有提供个方法,好像是什么 insertXXXX的把这个网页直接插入进去,以前我做类似的事情,中有想过很好
wdDoc.Paragraphs.Add(ref Nothing);
wdDoc.Paragraphs.Last.Range.Text = "text2"; //插入图片要用到Selection对象,所以应新建一个段落,然后在插入段落处调用Select()函数
wdDoc.Paragraphs.Add(ref Nothing);
wdDoc.Paragraphs.Last.Range.Select(); //Start Word and create a new document.
wdApp.Selection.Font.Bold = 1;
wdApp.Selection.Font.Size = 18;
wdApp.Selection.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphCenter;
wdApp.Selection.InlineShapes.AddPicture(imageFile , ref Nothing , ref Nothing , ref Range);