Novell is now a part of Micro Focus

I am trying to find a way to...

Articles and Tips: qna

01 Jul 2003


Q.

I am trying to find a way to edit the Macros section of a ZEN application object through my Visual Basic 6 application. The only way I have found to read these values is by SaveFieldValueToFile, but how do I display these values to the user of my application so they can edit them?

A.

The code below extracts the macro information to the file "C:\asxmacros.txt" and writes the macro name and value to a listview control.

Dim Entry As NWEntry
	Set Entry = NWDir1.FindEntry(NWBrowse1.SelectedEntries.item(0).FullName)
	Entry.SaveFieldValueToFile "App:Macros", "C:\asxmacros.txt", True
	ListView1.ListItems.Clear
	Dim text As String
	Open "C:\asxmacros.txt" For Binary As #1
	Macro_file = LOF(1)
	text = Space$(24)
	Get #1, , text
	Do While Seek(1) < LOF(1)
		text = Space$(12)
		Get #1, , text
		text = Space$(4)
		Get #1, , text
		size = Asc(text)
		text = Space$(size)
		Get #1, , text
		Macro_Name = text
		text = Space$(4)
		Get #1, , text
		size = Asc(text)
		text = Space$(size)
		Get #1, , text
		Macro_Value = text
		With ListView1.ListItems.Add(, , Macro_Name)
			With .ListSubItems.Add(, , Macro_Value)
			End With
		End With
	Loop
	Close #1

* Originally published in Novell AppNotes


Disclaimer

The origin of this information may be internal or external to Novell. While Novell makes all reasonable efforts to verify this information, Novell does not make explicit or implied claims to its validity.

© Copyright Micro Focus or one of its affiliates