|
-
Oct 12th, 2004, 10:24 AM
#1
Thread Starter
Fanatic Member
Visio Selection from VB6
hello, i have been able (with lots of help) to make shapes and position them in visio2000. but now what i need to do is be able to select more than one item and group them as one shape. any ideas?
"...Men will still say THIS was our finest hour"
If a tree falls in the woods and no one is there to see it, do all the other trees make fun of it?
-
Oct 12th, 2004, 11:17 AM
#2
Hyperactive Member
so sorry to ask, but what is visio2000? and what does it have to do with VB?
-
Oct 12th, 2004, 11:47 AM
#3
Thread Starter
Fanatic Member
Visio2000 is a microsoft program that is used for flowcharts graphical things for reports etc. i have used VB6 to open it, and to put some data and other things in there, i just need to know if it is possible to group from VB6.
"...Men will still say THIS was our finest hour"
If a tree falls in the woods and no one is there to see it, do all the other trees make fun of it?
-
Oct 12th, 2004, 12:01 PM
#4
Hey Dubya007, I see your on the project again. I know there is a
way to do it. I was starting to try it out last time we were
working on the shape adding/positioning. Let me see if I can find
it again.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 12th, 2004, 12:13 PM
#5
Thread Starter
Fanatic Member
Hey RobDogg good to hear from you again. i didn't think of that earlier. but now i have to do it. i have been looking on the net for a way, i think that i may have found a way but it doesn't seem to work. i think that it has some thing to do with
activewindow.select
but i am unsure
"...Men will still say THIS was our finest hour"
If a tree falls in the woods and no one is there to see it, do all the other trees make fun of it?
-
Oct 12th, 2004, 12:30 PM
#6
Same here!
Look into the Shape methods. I am quite sure it was in there. The
methods Group and UnGroup. I'm a little busy but I will try to help
as I get the time.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 12th, 2004, 12:35 PM
#7
Thread Starter
Fanatic Member
ok sounds good. if i find it i will let you know,so that you'll have it in case you ever need it.
"...Men will still say THIS was our finest hour"
If a tree falls in the woods and no one is there to see it, do all the other trees make fun of it?
-
Oct 12th, 2004, 12:41 PM
#8
Thanks.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 12th, 2004, 01:19 PM
#9
Thread Starter
Fanatic Member
When you get a second take a look at this code
VB Code:
Dim y As String
Dim x As Variant
With VisioDocument.Pages("Page-1")
For Each x In .Shapes
y = Right(x.Name, Len(x.Name) - InStrRev(x.Name, "."))
Select Case y
Case 64, 65, 66, 67, 68, 69, 70
ActiveWindow.Select x, visSelect
End Select
Next
ActiveWindow.Group
End With
not sure why but i get the following error do i need to add a library or something?
ERROR
ActiveX component cant create object
"...Men will still say THIS was our finest hour"
If a tree falls in the woods and no one is there to see it, do all the other trees make fun of it?
-
Oct 12th, 2004, 01:26 PM
#10
That looks too error prone.
Try duplicating this example from the Visio help file.
Groups the objects that are selected in a selection, or it converts
a shape into a group.
VB Code:
'This Microsoft Visual Basic for Applications (VBA) macro
'demonstrates dropping shapes using the Page, Document,
'and Shape objects.
Public Sub Drop_Example ()
Dim shp1Obj As Visio.Shape
Dim shp2Obj As Visio.Shape
Dim shp3Obj As Visio.Shape
Dim mstObj As Visio.Master
Set shp1Obj = ActivePage.DrawRectangle(1, 2, 2, 1)
Set shp2Obj = ActivePage.DrawRectangle(1, 4, 2, 3)
'Example of Page.Drop
ActivePage.Drop shp1Obj, 3.5, 3.5
Set shp3Obj = ActivePage.Shapes(3)
'Example of Document.Drop - Creates a master
Set mstObj = ActiveDocument.Drop(shp3Obj, 0, 0)
'Example of Shape.Drop
ActiveWindow.DeselectAll
ActiveWindow.Select shp1Obj, visSelect
ActiveWindow.Select shp2Obj, visSelect
ActiveWindow.[b]Group[/b]
Set shp1Obj = ActivePage.Shapes(2)
shp1Obj.Drop shp3Obj, 3, 3
End Sub
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 12th, 2004, 01:39 PM
#11
Thread Starter
Fanatic Member
i tried this in there just to see if it would work
ActiveWindow.DeselectAll
and i got the same error so, in light of that i need to figure out why that wouldn't work then maybe i can select the rest of the thing right?
"...Men will still say THIS was our finest hour"
If a tree falls in the woods and no one is there to see it, do all the other trees make fun of it?
-
Oct 12th, 2004, 02:22 PM
#12
Try this to add the selected shapes as a group.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 12th, 2004, 02:23 PM
#13
And to ungroup a selected shape...
VB Code:
ActiveWindow.RemoveFromGroup
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 12th, 2004, 02:33 PM
#14
Thread Starter
Fanatic Member
i think that the error is coming from ActiveWindow. the debugger always points to the first line that says active window
"...Men will still say THIS was our finest hour"
If a tree falls in the woods and no one is there to see it, do all the other trees make fun of it?
-
Oct 12th, 2004, 02:40 PM
#15
Try running it without stepping through the code. I think that since
you may be stepping, there is no active window.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 13th, 2004, 07:44 AM
#16
Thread Starter
Fanatic Member
i tried it and i still get the error. do you think that when the visiodocument is opened that i should activate it some how. like put in
Code:
ActiveWindow.Enabled
'or
ActiveWindow.Activate 'is that even one?
"...Men will still say THIS was our finest hour"
If a tree falls in the woods and no one is there to see it, do all the other trees make fun of it?
-
Oct 13th, 2004, 07:51 AM
#17
If you are coding from VB6, you must have some application object.
I think you need to add this to the code, because vb doesn't know that ActiveWindow has something to do with visio.
Something like:
appVisio.ActiveWindow.Select x, visSelect
-
Oct 13th, 2004, 07:59 AM
#18
Thread Starter
Fanatic Member
yeah that is what you have to do, i was just going to get on and type back the solution. thanx for the help.
VB Code:
VisioApplication.ActiveWindow.DeselectAll
"...Men will still say THIS was our finest hour"
If a tree falls in the woods and no one is there to see it, do all the other trees make fun of it?
-
Oct 18th, 2004, 01:48 PM
#19
Thread Starter
Fanatic Member
any one know if it is possible to change the size of the shapes from vb6?
"...Men will still say THIS was our finest hour"
If a tree falls in the woods and no one is there to see it, do all the other trees make fun of it?
-
Oct 18th, 2004, 02:04 PM
#20
Hey Dubya, Sup!
I thought we covered that in the original thread? Remember PinX
and PinY I believe it was.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Oct 19th, 2004, 07:45 AM
#21
Thread Starter
Fanatic Member
Sup Dogg,
the PinX and the PinY were dealing with the positioning of the shape. if the cell of the shape is set to the center then the PinX & PinY are the coordinates of the center cell.
"...Men will still say THIS was our finest hour"
If a tree falls in the woods and no one is there to see it, do all the other trees make fun of it?
-
Oct 19th, 2004, 10:13 AM
#22
Ok, I opened my VB_Visio project and here is the code.
VB Code:
'Stretch image
shp1Obj.Cells("Width") = 2 'Unit is Inches
shp1Obj.Cells("Height") = 2.5
We did use this in the beginings of the original thread.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|