从actionlistener对象获取字符串

时间:2013-01-01 10:21:24

标签: asp.net-mvc

  

可能重复:
  Changes to MS WORD through C#

我正在执行以下代码。 def()返回一个文件名。我将返回的文件名存储在actionresult中。如何从操作结果中获取此文件名

public ActionResult abc()
        {
             ActionResult sc = def();

            Word.Application app = new Word.Application();
            app.Documents.Save(sc.GetType());
            return sc;

        }

public ActionResult def()
        {
            Word.Application app = new Word.Application();
            Word.Document dd = app.Documents.Open("C:\\hi12.docx");
            dd.TrackRevisions = true;
            int count = dd.Words.Count;
            dd.Save();
            dd.Close(ref Nothing, ref format, ref Nothing);
            return File(("C:\\hi12.docx"), ("application/vnd.openxmlformats-officedocument.wordprocessingml.document"), ("ank"));
        }

0 个答案:

没有答案