Bekijk de onderstaande video om te zien hoe je onze site als een web app op je startscherm installeert.
Opmerking: Deze functie is mogelijk niet beschikbaar in sommige browsers.
Ik loop nu voor al vast met het plakken in een ander document. Het is namelijk de bedoeling dat ik van meerder e docx de tekst onder elkaar kan plakken. daar bedoel ik dan mee als ik de 1e knop in druk komt die text in dat lege document en bij de 2e knop dat dan de tekst er onder komt te staanHeb je wat meer informatie over de omgeving?
Bewerken van Word kun je door middel van de office automation tools. De truc is vaak om in het document de juiste plaats te vinden om te plakken. Dat is een stuk minder triviaal in Word dan in bijvoorbeeld excel of powerpoint.
Waar loop je vast? interactie met Word? selecteren van de juiste text? plakken op de juiste locatie?
Word.Application oWord = new Word.Application();
Word.Document oWordDoc = new Word.Document();
Object oMissing = System.Reflection.Missing.Value;
object oTemplatePath = @"C:\\Documents and Settings\\Student\\Desktop\\ExportFiles\\" + "The_One.docx";
oWordDoc = oWord.Documents.Add(ref oTemplatePath, ref oMissing, ref oMissing, ref oMissing);
oWordDoc.ActiveWindow.Selection.WholeStory();
oWordDoc.ActiveWindow.Selection.Copy();
oWord.ActiveDocument.Select();
oWord.Visible = true;
oWordDoc.ActiveWindow.Selection.PasteAndFormat(Word.WdRecoveryType.wdPasteDefault);
// pseudocode om overzichtelijk te houden
Doc1 = oWord.Documents.Open(...);
Doc2 = oWord.Documents.Add(...);
Doc1.Copy();
Doc2.Paste();
Doc1.Close();
Doc1 = oWord.Documents.Open(...);
Doc1.Copy();
Doc2.Paste();
Doc1.Close();
// etc etc.
Maar je kunt met dezelfde code toch een referentie aanmaken naar je 2de document?
Code:// pseudocode om overzichtelijk te houden Doc1 = oWord.Documents.Open(...); Doc2 = oWord.Documents.Add(...); Doc1.Copy(); Doc2.Paste(); Doc1.Close(); Doc1 = oWord.Documents.Open(...); Doc1.Copy(); Doc2.Paste(); Doc1.Close(); // etc etc.
Doc2.Bookmarks("bookmark1").Paste
Microsoft.Office.Interop.Word.Application oWord = new Microsoft.Office.Interop.Word.Application();
Microsoft.Office.Interop.Word.Document oWordDoc = new Microsoft.Office.Interop.Word.Document();
Object oMissing = System.Reflection.Missing.Value;
oWordDoc.ActiveWindow.Selection.WholeStory();
oWordDoc.ActiveWindow.Selection.Copy();
oWord.ActiveDocument.Select();
oWord.Visible = true;
oWordDoc.ActiveWindow.Selection.PasteAndFormat(Microsoft.Office.Interop.Word.WdRecoveryType.wdPasteDefault);
Doc1 = oWord.Documents.Open(...);
Doc2 = oWord.Documents.Add(...);
Doc1.Copy();
Doc2.Bookmarks("bookmark1").Paste
Doc1.Close();
Doc1 = oWord.Documents.Open(...);
Doc1.Copy();
Doc2.Bookmarks("bookmark1").Paste
Doc1.Close();
Microsoft.Office.Interop.Word.Application oWord = new Microsoft.Office.Interop.Word.Application();
Microsoft.Office.Interop.Word.Document Doc1 = new Microsoft.Office.Interop.Word.Document();
Microsoft.Office.Interop.Word.Document Doc2 = new Microsoft.Office.Interop.Word.Document();
Object oMissing = System.Reflection.Missing.Value;
Doc1.ActiveWindow.Selection.WholeStory();
Doc1.ActiveWindow.Selection.Copy();
oWord.ActiveDocument.Select();
oWord.Visible = true;
Doc2.ActiveWindow.Selection.PasteAndFormat(Microsoft.Office.Interop.Word.WdRecoveryType.wdPasteDefault);
Microsoft.Office.Interop.Word.Application oWord = new Microsoft.Office.Interop.Word.Application();
Microsoft.Office.Interop.Word.Document Doc1 = new Microsoft.Office.Interop.Word.Document();
Microsoft.Office.Interop.Word.Document Doc2 = new Microsoft.Office.Interop.Word.Document();
Doc1 = oWord.Documents.Open("test.doc");
Doc2 = oWord.Documents.Add();
Doc1.Visible = true;
Doc2.Visible = true;
Doc1.Content.Copy();
Doc2.Content.Paste();
We gebruiken essentiële cookies om deze site te laten werken, en optionele cookies om de ervaring te verbeteren.