Hello,
I have a VSTO program that grabs information from a .NET web service,
populates a user defined control with the info, and adds the control to the
word document.
I'm adding the controls (called "entry") to the word document like this:
Dim start As Object = Globals.ThisDocument.Content.End - 1
Globals.ThisDocument.Controls.AddControl(entry,
Globals.ThisDocument.Range(start, start), _
newWidth, newHeight, currentIssue.IssueKey)
This works fine, until I get to the bottom of the page. I would expect that
if I'm at the bottom of the page, and the control will not fit, that
AddControl would go to the next page, and insert. But this is not the case.
Because the control won't fit on the page, I get an "Error! Not a valid
embedded object." written to my document, instead of the control.
I'm new to VSTO so I'm asking is there anyway to detect to see if the
control will fit on the page, and if not, create a new page, and then embed
it?
Thanks!
|