Really I am trying, but I am beginning to believe that I hate Interop.
I am trying to add a paragraph to the end of a document I have open.
The range cannot be deleted error only happens sometimes.Code:Dim newPara As Word.Paragraph = docAChap.Paragraphs.Add With newPara .Range.Text = _schn ''The range cannot be deleted error here sometimes .Range.Font.Bold = 1 .Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter End With
It has to be something simple, like me.
Someone please tell me there is a way to insert a file without losing the format of the file being inserted.
This inserts the file but formatting is gone.Code:rng = docAChap.Range(Start:=DirectCast(docAChap.Content.End - 1, Object), End:=DirectCast(docAChap.Content.End, Object)) rng.Collapse(Word.WdCollapseDirection.wdCollapseEnd) rng.InsertFile(FileName:="pathHere".ToString)
I know that this looks like a two topic thread, but it is only one, me hatin' on Interop![]()




Reply With Quote
