"Unexpected End of File" C# application

S

ssathasivan

Hi Everyone ,

I added a new shape ( a valve) to a visio diagram ... and it had the
following Custom properties (Description ,Line Size , Valve Class ,
Manufacturer, Model) by default ... I loaded this vsd file in a C#
winform application....

when i try to get access the Description cell by using a the
following code
get_Cells("Prop.Description") ... it works fine ...

After that i added a new custom property called Test... i can see this
property in Visio ... However when i use the code
get_Cells("Prop.Test") , i am getting an exception "Unexpected End of
File"

Can any one help me...

Thanks
Sabarish
 
D

David Parker

Did you Name the Property Test, or did you just Label it?
Either switch on Developer Mode to use the Define dialog, or use the
ShapeSheet.
 
S

ssathasivan

I think i labelled it.... Can you guide me how to do this in
developer mode. or use shapesheet... i am a complete newbie in visio
and this is an important part of the project... Please help me
 
D

David Parker

If you go to Tools / Options /Advanced, then ensure that Run in Developer
Mode is ticked.
The Define Shape Data / Custom Property dialog will be extended when you
open it next time.

Alternatively, the ShapeSheet can be opened from Window / Show ShapeSheet
(or even from the right mouse menu when you are in Developer Mode)

The syntax Prop.MyProp always referes to the Name of the row, which will be
Row_n by default.
 
S

Shailendra Singh

Hi There,

I am trying to drop shapes on page randomly & after connected them.Please see this link which I am trying to follow.

http://msdn2.microsoft.com/en-us/library/aa722522.aspx
Here the code line

int databaseKeyValue = newShape.get_Cells(_VisioPropCellPrefix + _IDColumn).get_ResultInt((short)Visio.VisUnitCodes.visNumber, 0);

in addItemsToDrawing Function

I am getting Unexpected end of file error.

I have added method public static void ReadANamedCustomProperty(
Microsoft.Office.Interop.Visio.Shape customPropertyShape,
string cellName, bool isLocalName)

but it's showing me customPropertShape is null

Can anybody help me out for this.

Regards
Shail

EggHeadCafe - .NET Developer Portal of Choice
http://www.eggheadcafe.com
 
T

Tia

Hi David, I noticed you helped the last person with their problem and I am
hoping you can help me. I was working on a Visio file remotely (eVSM drawing)
and something happened and the file closed. Since then I have been trying to
open the file and I keep getting the 'unexpected End of file' command. Is
there anyway I can open this file. I am working with Visio 2003 SP 2.

Thank you for your input,
Tia
 
D

David Parker

This error message is normally seen when code is trying to access a
shapesheet cell that doesn't exist.
Try switcing off autoamtion events and add-ins, then open the drawing.
If that works, then the add-in is at fault ... not the drawing.
 
T

Tia

Thank you for the response. How do I make sure that the animation & add-ins
are switched off?

thx,
Tia
 
D

David Parker

Visio 2003:

Tools / Options / Security
Uncheck "Enable COM add-ins"
Uncheck "Enable Automation Events"

Visio 2007:

Tools / Options / Advanced
Uncheck "Enable Automation Events"

Tools / Trust Center / Add-ins
Check "Disable all Application Add-ins"
 
T

Tia

Thank you for the steps. I tried that and the file did not open. It still
gives the same message:
'An error (1) occured during the action open
Unexpected end of file'

Can I open the document atleast as a picture so I can get the data. Meaning
I can do without actually editing the file. The data is what I really want to
retrieve?. Like could I open in paint as a bitmap? or something to that
effect. The intereting thing is that when I open the folder with this
particular file, I am able to preview the image in the 'Detail' on the bottom
left of the folder. So I am hoping that the program is able to 'read/pick-up'
the file but not able to open it. Possible?

Thanks again for your input.


I also tried something that was posted on this link & still didn't work.
http://support.microsoft.com/kb/910349/en-us?spid=2529&sid=global
 

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