D
dpirkle
I have the following C# code using COM interops to append one word doc to
another:
formatterDoc.Content.Copy();
object startPos = wordDoc.Content.End - 1;
object endPos = wordDoc.Content.End;
wordDoc.Range(ref startPos, ref endPos).Paste();
This works fine, generally, but if the document to append contains
hyperlinks, they appear in the merged document without hyperlink capability
or formatting (underlined blue text). All that is left of each hyperlink is
the text: you can't ctrl/click on the text to navigate to a linked site.
I found that if I replace the call to Paste() with a call to
PasteAndFormat(WdRecoveryType.wdFormatOriginalFormatting), the hyperlink
formatting will be retained, so that the text appears blue and underlined,
but the underlying hyperlink is still missing and non-functional.
Any suggestions on how I can retain the hyperlinks? This is for Word 2003,
by the way.
another:
formatterDoc.Content.Copy();
object startPos = wordDoc.Content.End - 1;
object endPos = wordDoc.Content.End;
wordDoc.Range(ref startPos, ref endPos).Paste();
This works fine, generally, but if the document to append contains
hyperlinks, they appear in the merged document without hyperlink capability
or formatting (underlined blue text). All that is left of each hyperlink is
the text: you can't ctrl/click on the text to navigate to a linked site.
I found that if I replace the call to Paste() with a call to
PasteAndFormat(WdRecoveryType.wdFormatOriginalFormatting), the hyperlink
formatting will be retained, so that the text appears blue and underlined,
but the underlying hyperlink is still missing and non-functional.
Any suggestions on how I can retain the hyperlinks? This is for Word 2003,
by the way.