-
08-01-2015, 04:44 PM #1Junior Member
- Ngày tham gia
- Sep 2015
- Bài viết
- 0
lỗi khi sử dụng Microsoft.Office.Interop.Word
Mình có 1 đoạn code như sau:
Microsoft.Office.Interop.Word.Application _WordApp = new Microsoft.Office.Interop.Word.Application();
Microsoft.Office.Interop.Word.Document _ExportDoc = null;
object missing = Type.Missing;
object readOnly = false;
object isVisible = false;
_WordApp.Visible = false;
_ExportDoc = _WordApp.Documents.Open(strPathCopyed, ref missing, ref readOnly, 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);
object matchCase = true;
object matchWholeWord = true;
object matchWildCards = false;
object matchSoundLike = false;
object matchAllFOrms = false;
object forward = true;
object format = false;
object matchKashida = false;
object matchDiacritics = false;
object matchAlefHamza = false;
object matchControl = false;
object replace = 2;
object wrap = 1;
pWordApp.Selection.Find.Execute("[findtext]",ref matchCase,ref matchWholeWord, ref matchWildCards,ref matchSoundLike, ref matchAllFOrms, ref forward, ref wrap, ref format, ref "[Replacetext]", ref replace, ref matchKashida, ref matchDiacritics, ref matchAllFOrms, ref matchControl);
.........
Khi mình chạy trên máy mình thì ok. Nhưng khi publish và đưa lên máy sever, và sử dụng thì phát sinh ra lỗi:"Object reference not set to an instance of an object" ở dòng pWordApp.Selection.Find.Execute
Các bạn giúp mình khắc phục vớiView more random threads:
- Đổi tên localhost thành tên khác như thế nào?
- Phân trang Datalist trong ASP.NET như thế nào?
- Hỏi về lỗi The provided anti-forgery token was meant for user "teo", but the current user is "admin".
- Sơ đồ các trận đấu-các đối thủ găp nhau
- Cách phóng to toàn màn hình một trang web
- Gửi email khi người dùng quên mật khẩu trong ASP.NET như thế nào?
- Cách nén Viewstate và tốc độ load website ASP.NET
- Cách làm ẩn 1 node trong file XML như thế nào?
- Câu lệnh kết nối với database tạo bằng Sql 2000 viết thế nào
- Cập nhật calender tự động vào SQL
-
09-01-2015, 04:39 PM #2Junior Member
- Ngày tham gia
- Sep 2015
- Bài viết
- 0
http://diendan.congdongcviet.com/threads/t220341::microsoft-office-interop-excel-khong-chay-tren-iis.cpp
Pallet nhựa Long An đã trở thành một trong những lựa chọn phổ biến cho nhu cầu vận chuyển và lưu trữ hàng hóa trong nhiều ngành công nghiệp. Với đặc tính nhẹ nhàng, chắc chắn và dễ vận chuyển, các...
Thanh lý pallet nhựa Long An giá rẻ