Comment pouvons-nous ouvrir un fichier Word avec un numéro de page spécifique en c sharp?

Comment pouvons-nous ouvrir un fichier Word avec un numéro de page spécifique?

C’est le code que j’ai utilisé pour ouvrir le fichier:

public static Application Open(ssortingng 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); return wordApplication; } catch (Exception ex) { LogEntry log = new LogEntry(); log.Categories.Add("Trace"); log.Message = ex.ToSsortingng(); Logger.Write(log, "Trace"); throw new System.IO.FileLoadException("File cannot be opened"); } finally { wordApplication = null; } } 

Comment utiliser le code Vba Selection.GoTo What:=wdGoToPage, Which:=wdGoToFirst, Count:=3, Name:="" équivalent en C# pour obtenir la page souhaitée Ou d’autres suggestions?

L’équivalent C # interop serait:

 object what = Microsoft.Office.Interop.Word.WdGoToItem.wdGoToPage; object which = Microsoft.Office.Interop.Word.WdGoToDirection.wdGoToFirst; object count = 3; wordApplication.Selection.GoTo(ref what, ref which, ref count, ref missing);