Visio Guy

Visio Discussions => General Visio => Topic started by: Bald Eagle on February 29, 2016, 09:26:16 PM

Title: Problems selecting overlapping text
Post by: Bald Eagle on February 29, 2016, 09:26:16 PM
I have some very large text objects that I'm trying to precisely position.
The trouble arises with certain fonts/typefaces that have a large amount of empty space in their bounding box.
I can't seem to find a place to click in order to select smaller, "less-bounded" text, and trying to drag a selection box doesn't work because the bounding box of the other font/typeface is SO large!
Are there any tricks to "click-through" or otherwise accurately and reliablt select exactly what I need to select?

As always,
Thank you for your help.
Title: Re: Problems selecting overlapping text
Post by: Yacine on March 01, 2016, 07:25:15 AM
Hi Bald Eagle,
Use Inkscape to generate the shapes.
Create a regular text, then convert it to paths. Copy paste the result to Visio.
Title: Re: Problems selecting overlapping text
Post by: Bald Eagle on March 01, 2016, 02:35:11 PM
Arg.  Yeah, that's not going to work, since I still have to move and stretch and resize the letters.
Unless what you're suggesting actually gives me SVG objects that will do (most of) the fancy stuff that Chris' WordCloud smart shape does with text...   I will investigate later, since this also ties in with other things I'm doing.

Still learning InkScape, but I now know how to do what you're saying.    Thanks!   :)
Title: Re: Problems selecting overlapping text
Post by: Yacine on March 01, 2016, 04:26:42 PM
Alternatively one could find out the margins of the specific font and build up a shape that takes these data into consideration for defining the limits of the shape.
This would be much smarter, ... but tedious.
Title: Re: Problems selecting overlapping text
Post by: Bald Eagle on March 01, 2016, 05:46:26 PM
Yeah - I'm not sure that feasible, and that's probably way outside my present skill set.

That Sheet 4 error in the Word Cloud file is killing me.   Can't save as SVG because of it, so there's no way to export it that way.
Now I've got all of that stuff "stuck" in a file that can't be copied or exported except as png.

Usable, but less than ideal.
Any way to track down where the erroneous reference to Sheet 4 is?
Is there a way to globally search shape sheets and masters?
Title: Re: Problems selecting overlapping text
Post by: Surrogate on March 01, 2016, 06:25:45 PM
https://blogs.msdn.microsoft.com/visio/2006/07/14/error-318-explained/
Read this article please
Title: Re: Problems selecting overlapping text
Post by: Surrogate on March 02, 2016, 04:27:40 AM
Quote from: abssorb on October 08, 2014, 12:16:57 AM
Visio 2013 gives error 318 on copy with certain shapes.  There are smartshapes in the document stencil which pull in data from the background sheet.   These shapes cause a #318 error when "Copy" is used on any page except background.  The exact same file works perfectly in Visio 2003.

An Error (318) occurred during the action Copy.
Referenced cell Pages[Sheet.4]! does not exist


I've spent hours trying to find which cell or formula references Pages[Sheet.4] but I can't find anything.  I also don;t think anything is referencing thedoc which I've found as a possible using search.
Quote from: Surrogate on September 26, 2014, 12:10:43 PM
This macro can repair your file. It replace formulae in TheDoc cell by their value
it can repair your file in case when document's shapesheet contain formulae like as Pages[sheet.4]
Title: Re: Problems selecting overlapping text
Post by: Bald Eagle on March 03, 2016, 01:29:38 AM
Thanks Surrogate!   :)

Just having some problems with Visio 2007 digesting that code.
Sure looks ok to me, but what do I know...

Any ideas?
Title: Re: Problems selecting overlapping text
Post by: JuneTheSecond on March 03, 2016, 02:30:17 AM
Please try next and check result.
Debug.Print ActiveWindow.Shape.Name

ActiveWindow.Shape returns page, OK?
Title: Re: Problems selecting overlapping text
Post by: Surrogate on March 03, 2016, 06:44:11 AM
Quote from: JuneTheSecond on March 03, 2016, 02:30:17 AMActiveWindow.Shape returns page, OK?
No, my code must modify TheDoc cells
Bald Eagle, you get old code from comments to that article. Try use corrected code !
Quote from: Surrogate on September 26, 2014, 12:10:43 PM
This macro can repair your file. It replace formulae in TheDoc cell by their value
Sub vsd_RepairError318()
Dim cl As Row, ss As Window
Dim n As Integer
n = 0
Dim row_name$, row_value$, row_prompt$, new_prompt$, bl As Boolean
Set ss = Application.ActiveDocument.DocumentSheet.OpenSheetWindow
If ss.Shape.SectionExists(visSectionUser, visExistsAnywhere) Then
For i = ss.Shape.RowCount(242) - 1 To 0 Step -1
    row_name = Application.ActiveWindow.Shape.CellsSRC(visSectionUser, i, visUserValue).RowNameU
    row_formula = Application.ActiveWindow.Shape.CellsSRC(visSectionUser, i, visUserValue).FormulaU
    row_value = Application.ActiveWindow.Shape.CellsSRC(visSectionUser, i, visUserValue).ResultStr("")
    row_prompt = Application.ActiveWindow.Shape.CellsSRC(visSectionUser, i, visUserPrompt).FormulaU
    bl = InStr(row_formula, Trim("Pages["))
If bl = True Then '
n = n + 1
If n = 1 Then new_prompt = "setf(getref(thedoc!user." & row_name & "), " & Chr(34) & Chr(34) & Chr(34) & row_value & Chr(34) & Chr(34) & Chr(34) & ")"
If n > 1 Then new_prompt = new_prompt & "+setf(getref(thedoc!user." & row_name & "), " & Chr(34) & Chr(34) & Chr(34) & row_value & Chr(34) & Chr(34) & Chr(34) & ")"
Else
End If
Next
End If
Debug.Print new_prompt
If Len(new_prompt) > 0 Then
ActiveDocument.DocumentSheet.AddNamedRow visSectionUser, "Err318fix", visTagDefault
ActiveDocument.DocumentSheet.Cells("User.Err318fix.prompt").FormulaU = new_prompt
Application.ActiveWindow.Shape.DeleteRow visSectionUser, ActiveWindow.Shape.RowCount(242) - 1
End If
ss.Close
End Sub

Title: Re: Problems selecting overlapping text
Post by: Bald Eagle on March 03, 2016, 02:56:45 PM
Whoops   :-[

I pasted that in, and it seems to work great!   Thanks!
I posted a note about this on the Visio Guy World Cloud article so that people can easily see that the issue is fixable.
Maybe Chris will fix the source file and repost it so as not to propagate the problem.

I noticed that when I tried to drag a Word Cloud smartshape onto the master (I wanted a default unfilled version), that it changed the color to a dark yellow.   The same thing happens when I copy & paste a Word Cloud shape after running your macro.   That seems like curious behaviour.   Any idea what that's about?

Many, many thanks again!   Great work!    :)    :)    :)
Title: Re: Problems selecting overlapping text
Post by: Surrogate on March 03, 2016, 03:13:58 PM
Quote from: Bald Eagle on March 03, 2016, 02:56:45 PM
I posted a note about this on the Visio Guy World Cloud article
Thank you! What article are you mean ?
Title: Re: Problems selecting overlapping text
Post by: Bald Eagle on March 03, 2016, 10:37:10 PM
http://www.visguy.com/2015/11/25/area-filling-text-shape/ (http://www.visguy.com/2015/11/25/area-filling-text-shape/)