
Adding custom properties and assigning values.
Allan
1) For writing strings in cell, you have to use "quotet" strings!
2) Use object.Formula!
in your example, change to:
locObj.Cells("Prop.Address1.Type").Formula = 0
locObj.Cells("Prop.Address1.value").Formula = """beer"""
or locObj.Cells("Prop.Address1.value").Formula = chr(34)& "beer"& chr(34)
--
Regards
Peter Suter
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Quote:
> Hi there, I'm trying to drop a shape, create custom properties and then
> assign values to them.
> Here's the code:
> Dim locObj As Visio.Shape
> Set locObj = visDocument.Pages(1).Drop(locMstObj, i, 4)
> locObj.AddNamedRow visSectionProp, "Address1", 0
> locObj.Cells("Prop.Address1.Type") = 0
> locObj.Cells("Prop.Address1.value") = "beer"
> When I do this it gives me an error on the last line that says, "Type
> mismatch."
> If I assign an integer I have no problems, but I need to be able to
> assign a string.
> Have I missed some steps in configuring the property?
> Thanks in advance.