Is there a "Viewer" mode?

N

neilsolent

Hi

I am embedding the Visio ActiveX control in my own program. Is there
any way of enabling/disabling a "viewer" mode ? By "viewer" mode - I
mean a mode whereby the user cannot make any changes but can only view
the Visio diagrams - as if it were (temporarily) the free "Visio
Viewer" product.

thanks,
Neil
 
D

David Parker

I agree with that. You can use the Visio Viewer if you detect that the user
PC does not have Visio installed.
 
N

neilsolent

I think Microsoft only support embedding the viewer control in IE, and
not any other application. Is that not the case?
 
D

David Parker

Well, I have embedded in in several WinForms apps ... no problems.
Only issue is that you should set the VIsio Viewer as a pre-requisite in the
Setup & Deployment package in order to download it from Microsoft, rather
than you redistributing it.
 
N

neilsolent

David

I have gone with the Viewer approach as you suggested. Everything
works fine. The only issue I have now is - when a user clicks on a
shape, I need to programmatically get the layer that the shape belongs
to. Is that possible? Looking at the methods that the ActiveX control
provides, I don't think it is.

thanks,
Neil
 
P

Paul Herber

David

I have gone with the Viewer approach as you suggested. Everything
works fine. The only issue I have now is - when a user clicks on a
shape, I need to programmatically get the layer that the shape belongs
to. Is that possible? Looking at the methods that the ActiveX control
provides, I don't think it is.

The viewer can only do what it says on the box, there can be no
interaction with the diagram.
 
N

neilsolent

Hi Paul

What does "no interaction with the diagram" mean?
The viewer control tells you which shape was selected by generating an
event, and it even allows you to change the colors of the layers -
aren't these interactions?
What is special about getting the layer(s) that a shape is in (which
is obviously only a read operation) ?

thanks
Neil
 
P

Paul Herber

Hi Paul

What does "no interaction with the diagram" mean?
The viewer control tells you which shape was selected by generating an
event, and it even allows you to change the colors of the layers -
aren't these interactions?
What is special about getting the layer(s) that a shape is in (which
is obviously only a read operation) ?

Sorry, I think I've got the wrong end of this subject.
 
D

David Parker

Neil,

I don't think that you can find the layer of a shape using the Viewer object
model.

In fact, that is difficult in Visio too because a shape can consist of many
sub-shapes, and each of these shapes can be on none, one or many layers.
I'd be grateful that the Viewer enables you to switch layers on/off
selectively!

If you are creating diagrams that contain shapes that are always on a layer,
and all sub-shapes are always on the same layer, then you might consider an
extra custom property to hold this layer name.
But. remember that layers with the same name can have different indexes on
different pages because it just depends on the order that shapes were added
to the diagram, or new layers werre created.
 
N

neilsolent

David

OK, fair enough.

My app needs an embedded Visio diagram - I don't need much
functionality.

If I embed the full-blown app's control, it is an absolute nightmare
turning things off - and I can't just disable EVERY feature because
the end user will want to know why he has to have a licence for Visio
but my app does not allow him to edit his diagrams at all!

If I embed the viewer's control, it is much, much simpler and very
easy to use programmatically. I can do everything perfectly - except
for this one small featue that is missing. You obviously CAN find out
what layers each shape is in through Visio viewer (right click shape
and use menus) - there just doesn't seem to be any way to do it
programmatically.

Not to worry, I will do my best to cover up this omission in my
application :)

cheers,
Neil
 
D

David Parker

Yes, but no...
The shapes obviously understand which layer they are, but the reverse may
not be true ...
 

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