我試圖通過編程方式填寫一個Microsoft Word表單。 我成功地能夠這樣做,如果字符串是在255字符下使用下面的代碼,但它表示字符串太長,如果我嘗試使用字符串超過255個字符...我如何通過這個限制?如果我用word打開word文檔,我可以輸入超過255個字符而不會出現問題。有誰知道如何通過C#代碼輸入更多的字符?填寫超過255個字符的單詞表單字段
object fileName = strFileName;
object readOnly = false;
object isVisible = true;
object missing = System.Reflection.Missing.Value;
//open doc
_oDoc = _oWordApplic.Documents.Open(ref fileName, ref missing, ref readOnly,
ref missing, ref missing, ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref isVisible, ref missing, ref missing, ref missing, ref missing);
_oDoc.Activate();
//write string
_oDoc.FormFields[oBookMark].Result = value;
//save and close
oDoc.SaveAs(ref fileName, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);
_oWordApplic.Application.Quit(ref missing, ref missing, ref missing);