Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Other Office > Word VBA
|
Word VBA Discuss using VBA to program Word.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Word VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 5th, 2006, 01:47 AM
Authorized User
 
Join Date: Apr 2006
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default Word does not aswer to any Add-in

Hi,

I am newbie and i realy need help with my three questions i have worked on them 2 weeks but not success.

1. I built a shared Add-In project that worked good on ms word but i dont now what i have changed, now after many times debugging ms word does not answer any more to any add-in projects, I tryed to debugg my code i set "start external program" to Word.exe and used break points but my breakpoints dont work and i got message like
"the breakpoint will not currently be hit no symbols have been loaded for this document".

2. how can i insert a text as a custom property to the active word document?

3. i have built another add-in for Excel it works but i can not insert text to activeCell, I can see my toolbar and my button but it can not insert text.
here is a litle bit of my code:

Excel.Application excelApp = null;

public void OnConnection(object application, Extensibility.ext_ConnectMode c
onnectMode, object addInInst, ref System.Array custom)
{
  excelApp = (Excel.Application)application;
  insertText = MakeANewButton(toolBar, "Insert text", 1044, new _CommandBarB
 uttonEvents_ClickEventHandler(insertText
_Click));
}

private CommandBarButton MakeANewButton(CommandBar commandBar, string captio
n, int faceID, _CommandBarButtonEvents_ClickEventHandle
r clickHandler)
  {
     object missing = System.Reflection.Missing.Value;
     try
     {
        Microsoft.Office.Core.CommandBarButton newButton;
        newButton = (CommandBarButton)commandBar.Controls.Add(MsoContr olType
.msoControlButton, missing, missing, missing, missing);

         newButton.Caption = caption;
         newButton.FaceId = faceID;
         newButton.Click += clickHandler;
         return newButton;
      }
      catch
      {
          return null;
      }
   }


public void insertText_Click(CommandBarButton barButton, ref bool someBool)
{
   if (excelApp != null)
   {
      this.excelApp.ActiveCell.Value2 = "someText";
   }
}







Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamically add objects based on Word Bookmarks a4d2a0m VB How-To 2 February 27th, 2007 03:57 AM
Edit-add new entry to an acces table from word matpen Access 4 January 5th, 2006 06:30 PM
Add BLOB graphic files into a Word Document mckly Pro VB Databases 0 June 30th, 2004 08:57 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.