[英]C# Interop Word
什么是C#Interop Word等效于单词宏: varObj.Type = wdInlineShapeEmbeddedOLEObject
?
以下是我的C#程序的摘录。 除注释的行外,其他所有内容均有效。 我是C#的新手,感谢您的帮助。 谢谢。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using Microsoft.Win32;
using System.Diagnostics;
using Word = Microsoft.Office.Interop.Word;
namespace FindEmbeddedObjects
{
class Program
{
static void Main(string[] args)
{
foreach (var tempLoopVar_varObj in winword.ActiveDocument.InlineShapes)
{
//if (varObj.Type = wdInlineShapeEmbeddedOLEObject) // what is the C# equivalent
fileCount++;
//}
}
}
}
}
以下帮助吗?
using Word=Microsoft.Office.Interop.Word;
....
Word.Application wordApp = new Word.Application();
Word.Document document = wordApp.Documents.Open("C:\\myDoc.docx");
int fileCount = 0;
foreach (Word.InlineShape tempLoopVar_varObj in wordApp.ActiveDocument.InlineShapes)
{
if (tempLoopVar_varObj.Type == Word.WdInlineShapeType.wdInlineShapeEmbeddedOLEObject)
{
fileCount++;
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.