I think there is something with the number of parameters you provided in '
SaveAs
' method.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Office.Interop.Word;
namespace Test_InteropWord
{
class Program
{
static void Main(string[] args)
{
Application app = new Application();
Document doc = app.Documents.Add(Type.Missing,
Type.Missing,
WdDocumentType.wdTypeDocument, false);
doc.SaveAs(@"d:\tmp\test.docx");
((Microsoft.Office.Interop.Word._Document)doc).Close(true);
}
}
}
SaveAs method:
http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word._document.saveas%28v=office.14%29.aspx[
^]
[update]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MyWord = Microsoft.Office.Interop.Word;
namespace Test_InteropWord
{
class Program
{
static void Main(string[] args)
{
MyWord.Application app = new MyWord.Application();
MyWord.Document doc = app.Documents.Add(Type.Missing,
Type.Missing,
MyWord.WdDocumentType.wdTypeDocument, false);
doc.SaveAs(@"d:\tmp\test.docx");
((MyWord._Document)doc).Close(true);
}
}
}
When you refer any of classes in that assembly, you can use it with
MyWord
reference.