I am using winservice for creating Word docs.
The only problem I have is to Paste rtf to word Selection.
I have this code:
private static void PasteRtf(object bookmarkName,
OFFICE.Application wordApplication,
Document wordDocument, string rtfText, bool winservice)
{
if(bookmarkName == null ||
wordApplication == null ||
wordDocument == null) return;
if (!winservice)
{
Clipboard.Clear();
Clipboard.SetText(rtfText, TextDataFormat.Rtf);
IDataObject formatedText = Clipboard.GetDataObject();
if (formatedText != null)
{
wordDocument.Bookmarks[bookmarkName].Range.Select();
Selection sel = wordApplication.Selection;
sel.Paste();
}
Clipboard.Clear();
}
else
{
????
}
}
Do you have any idea how to do that without using Clipboard?