I want add a text watermark in word.
I use Microsoft.Office.Interop.Word 15. The same code works for office 2016 32-bit, but for office 365 64-bit, will throw the exception 'Element not found' 0x8002802B when I call ".AddTextEffect". How can I fix this problem?
wordDoc = wordApp.Documents.Open(file.FullName)
wordApp.Visible = True
'Create watermark
With wordDoc
.Activate()
.ActiveWindow.ActivePane.View.SeekView = Word.WdSeekView.wdSeekCurrentPageHeader
.ActiveWindow.ActivePane.Selection.HeaderFooter.Shapes.AddTextEffect(
Microsoft.Office.Core.MsoPresetTextEffect.msoTextEffect1,
watermark, font, 1,
Microsoft.Office.Core.MsoTriState.msoFalse,
Microsoft.Office.Core.MsoTriState.msoFalse, 0, 0)
End With
User contributions licensed under CC BY-SA 3.0