Einzelnen Beitrag anzeigen

Benutzerbild von Phoenix
Phoenix
(Moderator)

Registriert seit: 25. Jun 2002
Ort: Hausach
7.611 Beiträge
 
#4

AW: Text bei Textmarke einfügen

  Alt 7. Sep 2011, 10:40
...oder kann jemand behilflich sein beim Übersetzen dieses VBA Codes nach C#?

Code:
Sub UpdateBookmark(BookmarkToUpdate As String, TextToUse As String)
    Dim BMRange As Range
    Set BMRange = ActiveDocument.Bookmarks(BookmarkToUpdate).Range
    BMRange.Text = TextToUse
    ActiveDocument.Bookmarks.Add BookmarkToUpdate, BMRange
End Sub
(oder jemand ein C# Forum empfehlen?)
Code:
void UpdateBookmark(string bookmarkToUpdate, string textToUse)
{
  var range = ActiveDocument.Bookmarks(BookmarkToUpdate).Range;
  range.Text = textToUse;
  ActiveDocument.Bookmarks.Add(bookmarkToUpdate, range);
}
Sebastian Gingter
Phoenix - 不死鳥, Microsoft MVP, Rettungshundeführer
Über mich: Sebastian Gingter @ Thinktecture Mein Blog: https://gingter.org
  Mit Zitat antworten Zitat