GetFileNameOpen -> Modal

Hello,

 

I've been working on a program which prompts the user to open a Solid Edge assembly from a VB6 form. Withi VB 6, you have the option of Modal, which keeps the next open form "on top" of the calling form. Can this be accomplished when you call the SE "GetOpenFileName" interface?

 

For example:

 

SEPath = seApp.GetOpenFileName(SolidEdgeFramework.LinksUpdateOption.igNoLinksUpdate, _

tmpstring, SolidEdgeFramework.DocumentAccess.igReadOnly, _

SolidEdgeFramework.NotifyOption.igNoNotify, obj, "Solid Edge Assembly Files (*.asm),*.asm")

 

This call functions fine, but if the user clicks another window, the window disappears. The only thing that can be done is to kill the Edge.exe process.

 

Thanks,

 

- Bill

 

 

 

Posted by: Bill Ledbetter
Post date: 3/15/2006 12:45:03 AM

4 REPLIES

RE: GetFileNameOpen -> Modal

I'm familiar with the issue. What I would probably do is display my own Open File dialog instead of using SE's then call objApp.Documents.Open(). Not sure how to show a Open File dialog in VB6. In .NET we have an OpenFileDialog class that wraps the functionality and make it easy.

 

Posted by: Jason Newell
Post date: 3/16/2006 3:36:37 AM

RE: GetFileNameOpen -> Modal

Jason,

 

Thanks for the reply. I was originally doing just that via a Common Dialog with VB. The problem with that was that even though I could browse throught web folders, it was converting the document strin to:

 

C:\Documents and Settings\User\Temporary Internet Files

 

Thus, when I called for the command of Document.Open(), it would fail. Anyway, thanks again for the reply. I realized later that most of the problem was that I was running the program while debugging, so the VB windows was interfering. And thanks for the VB Studio input. Looks like I will probably just go for Standard Edition in the beginning, and have to recode some things anyway while attempting to learn .Net.

 

- Bill

 

Posted by: Bill Ledbetter
Post date: 3/16/2006 3:42:59 AM

RE: GetFileNameOpen -> Modal

I'm trying to have a preview of a list of SE files in our Access database.

 

I downloaded "preview.zip" and "seprev.zip" from binaries,

but those programs are too complicated for my VB6 programming level,

and they seems too heavy for our need.

 

To start easier : I tried to show the SE "open" windows from an XL file,

pointing on a knowned pathname.

 

I tried unsuccessfully to develop that with the

 

Object.GetOpenFileName(LinksUpdate, AltLinkPath, DocAccess, OptNotify, DocRelationAutoServer, FileFilter, FilterIndex, Title, IgnoreWarnings)

method in VB6.

 

(no VB error but no SE windows opening)

 

Could you help me providing me the "KEY lines" only of your VB program or telling me how to use activeX in office applications?

 

Thanks in advance

 

Ludovic Bouillon

Leroy Somer

 

Posted by: Ludovic BOUILLON
Post date: 3/28/2006 9:16:07 PM

RE: GetFileNameOpen -> Modal

Ludovic,

 

I'm assuming that you have the proper Reference libraries loaded in VB6? What I use that works, and creates a background instance of Solid Edge:

 

'Declare Public variables

Public seApp As Object

Public seAssydoc

Public tmpstring As String

Public SEPath As String

 

'Create an instance of Solid Edge

Set seApp = CreateObject("SolidEdge.Application")

seApp.DisplayAlerts = False

seApp.Visible = False

 

'Display the open dialog.

SEPath = seApp.GetOpenFileName(SolidEdgeFramework.LinksUpdateOption.igNoLinksUpdate, _

tmpstring, SolidEdgeFramework.DocumentAccess.igReadOnly, _

SolidEdgeFramework.NotifyOption.igNoNotify, obj, "Solid Edge Assembly Files (*.asm),*.asm", , "Magnatech / Solid Ege BOM Interface", True)

 

'Open the assembly

Set seAssydoc = seApp.Documents.Open(SEPath) THIS LINE OPENS THE SE FILE

-------------------------------------------------------------------------------------------------------

If you are using VB to iterate through an Access database, you need to use OpenRecordSets

 

Public Sub Main()

'Create Microsoft Jet Workspace object

Set wrkJet = CreateWorkspace("", "admin", "", dbUseJet)

Set dbsSolidEdge = wrkJet.OpenDatabase("Access_DataBase_Name.mdb", , , True)

With dbsSolidEdge

Set dbsAssembly = .OpenRecordset("Access_Table_Name", dbOpenSnapshot)

OpenRecordsetOutput dbsAssembly

End With

dbsSolidEdge.Close

wrkJet.Close

End Sub

 

Sub OpenRecordsetOutput(rstOutput As Recordset)

' Enumerate the specified Recordset object.

With rstOutput

Do While Not .EOF

Debug.Print , .Fields(0), .Fields(1) ' Whatever fields(i) you are looking for information from

.MoveNext

Loop

End With

End Sub

 

Look in VB6 Help for more info. Good luck

 

Posted by: Bill Ledbetter
Post date: 3/29/2006 12:20:10 AM