hej.
Mój kod:

       public ActionResult ReplaceText(int id)
        {
         
             

            
            Microsoft.Office.Interop.Word.Application fileOpen = new Microsoft.Office.Interop.Word.Application();
            Microsoft.Office.Interop.Word.Document document = fileOpen.Documents.Open(@"C:\Users\Desktop\test1.docx", ReadOnly: false);
            fileOpen.Visible = true;

            document.Activate();
           
            FindAndReplace(fileOpen,obj,obj1);
            
            document.SaveAs2(@"C:\Users\Desktop\NewFile1");
            
            fileOpen.Quit();
            return View();
        }
        
        static void FindAndReplace(Microsoft.Office.Interop.Word.Application fileOpen, object findText, object replaceWithText)
        {
            #region formatowanie
            object matchCase = false;
            object matchWholeWord = true;
            object matchWildCards = false;
            object matchSoundsLike = false;
            object matchAllWordForms = false;
            object forward = true;
            object format = false;
            object matchKashida = false;
            object matchDiacritics = false;
            object matchAlefHamza = false;
            object matchControl = false;
            object read_only = false;
            object visible = true;
            object replace = 2;
            object wrap = 1;
            #endregion format
            
            fileOpen.Selection.Find.Execute(ref findText, ref matchCase, ref matchWholeWord,
                ref matchWildCards, ref matchSoundsLike, ref matchAllWordForms, ref forward, ref wrap, ref format, ref replaceWithText, ref replace,
                ref matchKashida, ref matchDiacritics, ref matchAlefHamza, ref matchControl);

        }
       
    }

Funkcja działa tak jak powinna, że wyszukuje w tekscie słowo znajdujące się w obiekcie "obj" i nadpisuje go zawartością "obj1".
Problem polega na tym, że funkcja przyjmuje tylko referencje do object i nie bardzo wiem jak mógłbym pobrać np. listę/tabelę z bazy danych i wywołać funkcję FindAndReplace dla wszystkich pól danego obiektu (np. imie, nazwisko, miejscowosc, wiek itp) Zdaję sobie sprawę że każde wywołanie potrzebuje argumentu który ma zmienić oraz argumentu na który ma zmienić, jednak nie bardzo wiem jak wywołać tą funkcję dla wszystkich pól danego obiektu.