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. 在FlowLayoutPanel中獲取MouseWheel滾動位置
- 8. 獲取滾動元素的滾動位置whan滾動
- 9. 如何從使用C#的Microsoft Word中獲取特定部分
- 10. 點擊獲取存儲滾動位置
- 11. 獲取ScrollArea的滾動位置
- 12. 使用javascript獲取div滾動位置。
- 13. Android:獲取WebView的滾動位置
- 14. JS - scrollToEl獲取滾動位置
- 15. 獲取滾動位置百分比
- 16. 如何獲取列表框中的確切滾動位置?
- 17. 如何在水平滾動視圖中獲取位置
- 18. 如何獲取並設置當前網頁滾動位置?
- 19. 使用jquery獲取滾動位置
- 20. 我如何從wxPython中的wx.TextCtrl控件獲取滾動位置/範圍
- 21. 如何從服務中獲取位置
- 22. 如何從視圖中獲取位置?
- 23. 如何獲取上一個滾動視圖位置,滾動視圖
- 24. React Native VirtualizedList獲取滾動並滾動到位置
- 25. 如何獲取滾動指示器的位置?
- 26. 如何在用戶滾動時獲取位置固定
- 27. QTableView如何獲取滾動條的行位置
- 28. 如何獲取文檔的滾動位置?
- 29. 如何精確獲取頁面的最大滾動位置?
- 30. 如何獲取滾動div的更新頂部位置?
在期間滾動不會幫助我,我很害怕。在我的應用程序進入遊戲之前,用戶可能已經滾動了。我希望Execl的答案會導致Word的答案,但API看起來不夠完美。 – 2009-12-02 14:08:48
Gotcha。看到我編輯的消息。 – 2009-12-02 14:13:40