question about developing visio 2003 in VB2008

D

David82

i'm new here so if i wrote in the wrong place please refer me to the right
place.

i need to make a new application by changing the current visio application
to the product we need. so i used the add_in class for visio 2003 using VB
2008. the problem is that every change i made by using code, changed the
real visio in office. for example i deleted the menu item "File->open..."
and now every time i open visio there's no more File->open. i can't get it
back. i need the original visio and i need to know how i can write a code in
the add-in without changing the visio itself but its copy. anyone know how
to do it?
 
A

AlEdlund

Unfortunately I don't have v2003 loaded on this system. Check visio help for
add-in and it should show you how to disable installed add-ins, and disable
yours (since it appears that your's has taken over the menu bar). Menu bars
are shared between visio and all of the other add-ins, it's up to you to be
a good neighbor and clean up your solution when you close. If you haven't
checked this out maybe it can help.
http://msdn.microsoft.com/en-us/library/aa201793(office.10).aspx
al
 
D

David82

thank you for your answer.
but there're still some things i don't understand.
why should i clean up my solution if my purpose is to work on a copy of
visio and not on visio itself. if i work on visio itslef i really should
clean up my code when i exit like you said but it sounds an extremely hard
work. in fact, it sounds to me impossible. how can i bring back buttons
that i've deleted for example?

and second thing, i read the link that you gave me. it really explains all
the things i want to do (changing the menu bar). but i didn't understand
what editor i should use to write all the commands they wrote there. right
now i'm using visio add-in in VS2008 and i'm writing in c# and not in visual
basic. i was told at work that i should use c# for the code. unless i see
that visual basic is much preferable, i'd prefer to write in c# because it's
code that i understand much better (it's similar to c++ and java which i
already learned). so, i'll appreciate if you clarify for me all these
questions.

thank you
David
 
A

AlEdlund

add-ins are code that start with the visio application...
one of the more common approaches to ensure that the add-in does not touch
the menu bar inappropriately is to have the user open a template with a
persistent event that can tell the add-in that it can then apply changes to
the visio environment. When the document is closed, the environment can then
be reset.
Have you looked at the visio sdk yet?
al
 
D

David82

do you mean if i looked at code examples of visio sdk?
well yes i did. alot.
i'm working on it for weeks and unfortunatelly i haven't done much. i
downloaded from this site
http://www.microsoft.com/downloads/...bd-b0bb-46e7-936a-b8539898d44d&displaylang=en
some code examples for the visio sdk which were very helpful. i used only
the c# code.

i'm sorry i still didn't understand what you said. what template should the
user open and how can the environment be reset?

and also, i'd really like to know what editor i should use for the code
examples in the link you gave me. i tried the code in visio add-in in VB2008
and it didn't work.

is it ok if i stay with c# or should i move to visual basic.

sorry for all the questions i just want to progress with the program and
right now i'm stuck.

thank in advance
David
 
A

AlEdlund

There is a flowchart demo application (c#) in the sdk that should illustrate
a lot of what you are attempting to do. It has a template associated with it
(.vst file) that has persistent events assigned. You can examine the events
linked to the template using the menu bar tools => add-ons => sdk => tools
=> persistent events. You might try compiling and running the application to
see how some of this works together.
al
 
×

דוד

There is a flowchart demo application (c#) in the sdk that should illustrate
a lot of what you are attempting to do. It has a template associated with it
(.vst file) that has persistent events assigned. You can examine the events
linked to the template using the  menu bar tools => add-ons => sdk => tools
=> persistent events. You might try compiling and running the application to
see how some of this works together.
al












-הר××” טקסט מצוטט-

i'm not familiar with the persistent events you were talking about. i
read about it after you told me to look at it but i didn't understand
how to work with it. as far as i understood i should use persistent
events to compile the visio sdk code examples which were in the link i
sent you last time. but i actually compiled it in VB2008. for class
CreateMenu.cs in the sdk for example i created in the add-in a new
class with the same name and copied the code from sdk. then in the
ThisAddIn_Startup method i wrote "CreateMenu temp = new CreateMenu();
temp.AddMenuToMenuBar(this.Application);" maybe it's not the right
way to do it i really don't know. i could see that it worked so i
kept working this way. can you explain to me how to use the sdk for
the persistent events in visio? i read the help in visio about it but
it was very short and didn't explain what i wanted.

thank in advance
David
 
A

AlEdlund

Regarding visio events, I'd start over here
http://msdn.microsoft.com/en-us/library/aa201790(office.10).aspx
I'd continue your reading over here
http://msdn.microsoft.com/en-us/library/aa140366(office.10).aspx

al



There is a flowchart demo application (c#) in the sdk that should
illustrate
a lot of what you are attempting to do. It has a template associated with
it
(.vst file) that has persistent events assigned. You can examine the
events
linked to the template using the menu bar tools => add-ons => sdk => tools
=> persistent events. You might try compiling and running the application
to
see how some of this works together.
al












-הר××” טקסט מצוטט-

i'm not familiar with the persistent events you were talking about. i
read about it after you told me to look at it but i didn't understand
how to work with it. as far as i understood i should use persistent
events to compile the visio sdk code examples which were in the link i
sent you last time. but i actually compiled it in VB2008. for class
CreateMenu.cs in the sdk for example i created in the add-in a new
class with the same name and copied the code from sdk. then in the
ThisAddIn_Startup method i wrote "CreateMenu temp = new CreateMenu();
temp.AddMenuToMenuBar(this.Application);" maybe it's not the right
way to do it i really don't know. i could see that it worked so i
kept working this way. can you explain to me how to use the sdk for
the persistent events in visio? i read the help in visio about it but
it was very short and didn't explain what i wanted.

thank in advance
David
 
D

David

Regarding visio events, I'd start over herehttp://msdn.microsoft.com/en-us/library/aa201790(office.10).aspx
I'd continue your reading over herehttp://msdn.microsoft.com/en-us/library/aa140366(office.10).aspx

al






i'm not familiar with the persistent events you were talking about.  i
read about it after you told me to look at it but i didn't understand
how to work with it.  as far as i understood i should use persistent
events to compile the visio sdk code examples which were in the link i
sent you last time.  but i actually compiled it in VB2008.  for class
CreateMenu.cs in the sdk for example i created in the add-in a new
class with the same name and copied the code from sdk.  then in the
ThisAddIn_Startup method i wrote "CreateMenu temp = new CreateMenu();
temp.AddMenuToMenuBar(this.Application);"  maybe it's not the right
way to do it i really don't know.  i could see that it worked so i
kept working this way.  can you explain to me how to use the sdk for
the persistent events in visio? i read the help in visio about it but
it was very short and didn't explain what i wanted.

thank in advance
David- Hide quoted text -

- Show quoted text -
hi Al,
both links you sent me are in VBA. and they're using macros. my
intention was to write the code in c#.
you told me that the application in the sdk is written in c#. do you
have links for writing the add-ons persistent events in c# instead of
VBA?
 
A

AlEdlund

There are three pieces to this equation which are demonstrated in the v2007
SDK Flowchart sample.
a.) the event generated by putting a persistent event into your document
(whether it is a template/stencil/or just a replicated drawing) - this is
not code dependent and the example document is "Flowchart (CShartp.Net).vst"
b.) coding the necessary addadvise into your application - which is in the
connect.cs file
c.) the event sink - the example has the file eventsink.cs
The references are tutorial to give you insight not c#code, that is in the
flowchart sample I previously referenced.
'


Regarding visio events, I'd start over
herehttp://msdn.microsoft.com/en-us/library/aa201790(office.10).aspx
I'd continue your reading over
herehttp://msdn.microsoft.com/en-us/library/aa140366(office.10).aspx

al






i'm not familiar with the persistent events you were talking about. i
read about it after you told me to look at it but i didn't understand
how to work with it. as far as i understood i should use persistent
events to compile the visio sdk code examples which were in the link i
sent you last time. but i actually compiled it in VB2008. for class
CreateMenu.cs in the sdk for example i created in the add-in a new
class with the same name and copied the code from sdk. then in the
ThisAddIn_Startup method i wrote "CreateMenu temp = new CreateMenu();
temp.AddMenuToMenuBar(this.Application);" maybe it's not the right
way to do it i really don't know. i could see that it worked so i
kept working this way. can you explain to me how to use the sdk for
the persistent events in visio? i read the help in visio about it but
it was very short and didn't explain what i wanted.

thank in advance
David- Hide quoted text -

- Show quoted text -
hi Al,
both links you sent me are in VBA. and they're using macros. my
intention was to write the code in c#.
you told me that the application in the sdk is written in c#. do you
have links for writing the add-ons persistent events in c# instead of
VBA?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top