search
Twitter Rss Feeds
MicrosoftArticlesForumsGroups
C# .NET
VB.NET
Visual Studio .NET
ADO.NET
Xml/Xslt
VB 6.0
.NET CF
GDI+
LINQ
Deployment
Security
FoxPro
Silverlight / WPF
Entity Framework
RIA Services

Web ProgrammingArticlesForumsGroups
JavaScript
ASP
ASP.NET
Web Services

Non-MicrosoftArticlesForumsGroups
NHibernate
Perl
PHP
Ruby
Java
Linux / Unix
Apple
Open Source

DatabasesArticlesForumsGroups
SQL Server
Access
Oracle
MySQL
Other Databases

OfficeArticlesForumsGroups
Microsoft Excel
Microsoft Word
Microsoft Powerpoint
Publisher
Money

Operating SystemsArticlesForumsGroups
Windows 7
Windows Server
Windows Vista
Windows XP
Windows Update
MAC
Linux / UNIX

Server PlatformsArticlesForumsGroups
Share Point
BizTalk
Site Server
Exhange Server
IIS
Transaction Server

Graphic DesignArticlesForumsGroups
Macromedia Flash
Adobe PhotoShop
Microsoft Expression

OtherArticlesForumsGroups
Subversion / CVS
Ask Dr. Dotnetsky
Active Directory
Networking
Uninstall Virus
Job Openings
Reviews
Search Engines
Resumes

 

Previous Thread:   Deleting DOC file in Shutdown Event

2/28/2006 1:55:27 PM    Adding Controls To Word Document
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!


Pete's Blog   |    Pete's Resume   |    Robbe's Blog   |    Robbe's Resume   |    Archive #2   |    Archive #3   |    Dotnetslackers   |    XmlPitStop   |    Advertise   |   Contact Us   |   Privacy   |   Copyright (c) 2000 - 2009 eggheadcafe.com  All rights reserved.