I'm trying to develop an Action Pane with a button, this button should create an object like a Textbox in the Application.ActiveDocument. I found in msdn some information about the class Word.ControllCollection that should be right for me (I Hope
Is it right Is there any workaround
Thanks a lot.

Word.ControlCollection in an ActionPane
MauriceSibrandi
Develop Environment VStudio 2005
Language VB
VSTO Version 2005
Marcin Książek
Thanks for all
c_shah
Without seeing the code, its hard to determine what the problem is. I have an example of doing this in my book (VSTO for Mere Mortals), but since the book hasn't been published yet, I'll share a bit of the code here for you.
Things to keep in mind are:
If you have a button on a user control that you add to the actions pane, you can add the following code to the user control:
Public
Class UserControl1 Dim ControlCounter As Integer = 0 Private Sub Button1_Click(ByVal sender As System.Object, _ByVal e As System.EventArgs) Handles Button1.Click
Dim Selection As Word.Selection = _
Globals.ThisDocument.Application.Selection
Dim ControlName As String = "Control" & _
ControlCounter.ToString()
ControlCounter += 1
Globals.ThisDocument.Controls _
.AddTextBox(Selection.Range, 100, 50, ControlName)
End Sub
End Class
I hope this helps!
Kathleen McGrath
http://blogs.msdn.com/kathleen
elgor
Is the document you are adding to protected if so you will need to programatically unprotect it.