0
A
回答
0
您是否試圖從外部Word控制Word或者它是一個集成控件?
我想你想:Object oMissed = doc.Paragraphs[1].Range;
下面這段代碼是一個InlineShape,而不是形狀對象。 Shape對象用於文本包裝。
代碼:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Word = Microsoft.Office.Interop.Word;
namespace WordAddIn3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Word.Application wdApp = Globals.ThisAddIn.Application;
Word.Document doc = wdApp.ActiveDocument;
string fileName = "c:\\testimage.jpg"; //the picture file to be inserted
Object oMissed = doc.Paragraphs[1].Range; //the position you want to insert
Object oLinkToFile = false; //default
Object oSaveWithDocument = true;//default
doc.InlineShapes.AddPicture(fileName, ref oLinkToFile, ref oSaveWithDocument, ref oMissed);
}
}
}
微軟:HOWTO: How To Get 32-bit Scroll Position During Scroll Messages
同樣,你可能想看看這太問題上How do I get the scroll position from Microsoft Execl - 我才意識到有人問你..
相關問題
- 1. 如何從Microsoft Excel中獲取滾動位置
- 2. 如何從GridView獲取滾動位置?
- 3. 從VBA或C#Interop獲取Microsoft Word中的文本位置
- 4. 如何獲取RichTextBox的滾動位置?
- 5. 如何獲取滾動的RecyclerView位置
- 6. 從RichTextBox獲取滾動位置?
- 7. ListView獲取滾動位置?
- 8. 如何在滾動時獲取webview的垂直滾動位置
- 9. 如何在停止滾動後獲取滾動位置?
- 10. 在FlowLayoutPanel中獲取MouseWheel滾動位置
- 11. 如何獲得Microsoft Word文檔的準確窗口位置?
- 12. 如何從使用C#的Microsoft Word中獲取特定部分
- 13. 獲取滾動元素的滾動位置whan滾動
- 14. 如何在Microsoft Word中的佔位符
- 15. 點擊獲取存儲滾動位置
- 16. 獲取ListView中滾動條的位置(不是位置條目)
- 17. 獲取ScrollArea的滾動位置
- 18. 使用javascript獲取div滾動位置。
- 19. Android:獲取WebView的滾動位置
- 20. JS - scrollToEl獲取滾動位置
- 21. C#/ WPF - 獲取ScrollViewer的滾動位置?
- 22. 如何獲取表格中HTML元素的滾動位置?
- 23. 如何在Auto Complete中獲取滾動位置
- 24. 如何獲取列表框中的確切滾動位置?
- 25. 如何獲取可見滾動視圖中的按鈕位置?
- 26. 如何在水平滾動視圖中獲取位置
- 27. 獲取滾動位置百分比
- 28. 如何獲取並設置當前網頁滾動位置?
- 29. 如何獲取並設置TChromium滾動條位置?
- 30. Android獲取ListView中滾動位置的確切位置
在期間滾動不會幫助我,我很害怕。在我的應用程序進入遊戲之前,用戶可能已經滾動了。我希望Execl的答案會導致Word的答案,但API看起來不夠完美。 – 2009-12-02 14:08:48
Gotcha。看到我編輯的消息。 – 2009-12-02 14:13:40