how can we open a word file with specific page number. can anybody plz help me..??
this is the the code i used to open the file:
public static Application Open(string fileName)
{
object fileNameAsObject = (object)fileName;
Application wordApplication;
try
{
wordApplication = new Application();
object readnly = false;
object missing = System.Reflection.Missing.Value;
wordApplication.Documents.Open(ref fileNameAsObject, ref missing, ref readnly, 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);
return wordApplication;
}
catch (Exception ex)
{
LogEntry log = new LogEntry();
log.Categories.Add("Trace");
log.Message = ex.ToString();
Logger.Write(log, "Trace");
throw new System.IO.FileLoadException("File cannot be opened");
}
finally
{
wordApplication = null;
}
}
how can i use the vba code (Selection.GoTo What:=wdGoToPage, Which:=wdGoToFirst, Count:=3, Name:="" ) equivalent in c sharp to get the page that i want..??? or any other suggestions??