How to write into a custom properties cell

M

Moumoute83

Hi, I'd like a macro which let me store some values in my custom properties
of my shape. I have access into my Custom Properties cell but I'm not able to
store any value into it (exception error "#NAME?").
I successed with Size & Position ("Angle" cell) but not with Custom
Properties section.
Any suggestion ?

'-----------------------------------------------------
'My example :
If vsoShapes.Item(intCounter).Name = "shape1" Then
Set vsoCell = vsoShapes.Item(intCounter).Cells("Angle")
vsoCell.Formula = "90 deg" 'to store a new angle value (RESULT : it
works)

Set vsoCell = vsoShapes.Item(intCounter).CellsSRC(visSectionProp,
visRowProp, visCustPropsValue)
Debug.Print vsoCell.Formula 'This is the good value
vsoCell.Formula = "newargument" '(RESULT : error, even if I
try with "=newargument" because of the formula type)
End If
'-----------------------------------------------------
I tried to force formule too (GUARD mode or not), but it doesn't work anyways.
Thanks a lot for your help.
 
M

Moumoute83

I ever had the SDK, sorry.
But I've found THE solution ! It's so stupid...
I must put :
'-------------------------
vsoCell2.Formula = """newargument""" '(< triple quote)
'-------------------------

Thanks for answering me.
 
J

John Marshall, MVP

Any string used must be quoted. The outside quotes are stripped off during
processing, so the string needs to contain a quoted string within the
quotes. To represent a quote within a string it must be represented by two
quotes. So the final outcome is that the string is contained between a set
of three quotes at the front and three quotes at the end.

This is a common stumbling block when it comes to writing code for Visio.

John... Visio MVP
 

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