473,387 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

CommandBarButton in MS Word

Hello guys
I 've been digging for a while trying to add nice image to CommandBarButton
in MS Word using VS 2005 without aby luck.
I found http://blogs.msdn.com/vsto/archive/2.../18/44404.aspx and
http://support.microsoft.com/default...d=kb;en;288771
second one gives very good exmaple for merging image and mask in Clipboard
and paste face on button at once. there is some code for creating mask image
from source but it is on VB6 and it is quite inconvinient (and impractical)
to keep using API function while most of them has their .NET equivalents.
does anyone know some example of this in .NET?

I tried to load them in sample VB.NET 2005 project but I get ComException on
..PasteFace()
this is the code

buttonInsert = .Controls.Add(Type:=Core.MsoControlType.msoControl Button)
With buttonInsert
.Caption = "Insert Snippet"
Try
My.Computer.Clipboard.SetData("Toolbar Button Face",
My.Resources.ToolbarIcons.Manage)
My.Computer.Clipboard.SetData("Toolbar Button Mask",
My.Resources.ToolbarIcons.Mask)
.PasteFace()
Catch ex As Exception
Debug.WriteLine(ex.Message)
End Try

I am sure images are correct because I created them with code from MS Office
VBA help file (artice for CommadBarButton.Picture property)
Thank you in advance

--
Galin Iliev [MCSD, MCSD.NET]
Senior Software Developer
www.wordassist.com

--
Galin Iliev [MCSD, MCSD.NET]
Senior Software Developer
www.wordassist.com
Dec 7 '05 #1
0 987

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: maitrepoy | last post by:
I have to create a small addin which works on Powerpoint, Word, Outlook, and Excel on Office 2000, XP, and 2003. This addin consists in adding 2 new Buttons in the "File" Menu of office. This is...
4
by: Vincent | last post by:
I was wondering if the CommandBarButton OnAction property would allow you to specify a function from a module to be called. According to the post made by Turtle in 1998, the OnAction property can...
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
1
by: arnott | last post by:
hi all, I am writing a add-in for Outlook 2007 using C# and VSTO ( Visual Studio 2008). When the user clicks on each mailitem in the inbox (or any folder) in the active explorer window, the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.