-
WSDylan Morley
AskWoody LoungerRory,
Sounds good, but can’t see that reference anywhere…do you know the name of the DLL/OLB?
I’m halfway through writing the code using the Outlook Object Model anyway, so I’ll probably stick with this – but it’ll be nice to know I can use other libraries as well…
Thanks
-
WSDylan Morley
AskWoody LoungerThanks Hans, I was hoping there was a OutlookFolder.GetTotalSize method or something similar I had overlooked so I didn’t have to write my own code…
I suppose Microsofts ‘Get Folder Size’ button is simply doing what you have written, they could have been thoughtful enough to share!
Thanks for the response.
-
WSDylan Morley
AskWoody LoungerThis is a function I use to detect if a form is loaded, but you could change the syntax to test for various things…eg if it is the MDIForm.Activeform or if it is visible etc
‘ // ******************************************************************************
‘ // FUNCTION
‘ // IsFormLoaded(frm As Form) as Boolean
‘ //
‘ // PARAMETERS
‘ // fForm – The form to check to see if it is loaded
‘
‘ // RETURN VALUE
‘ // if the form is loaded
‘ //
‘ // COMPONENTS USED
‘ // None
‘ //
‘ // NOTES
‘ // Returns true if the passed form is loaded in the forms collection
‘ // ******************************************************************************Public Function IsFormLoaded(fForm As Form) As Boolean
On Error GoTo Err_ProcDim x As Integer
For x = 0 To Forms.Count – 1
If (Forms(x) Is fForm) Then
IsFormLoaded = True
Exit Function
End If
Next xIsFormLoaded = False
Exit_Proc:
Exit FunctionErr_Proc:
Msgbox Err.Description
Resume Exit_ProcEnd Function
-
WSDylan Morley
AskWoody LoungerYou can create ‘Master’ and ‘Detail’ forms using the Microsoft ‘Data Grid’ control. This would allow you to display a list of companies and all the contacts at each company, similar to Access.
Use the ‘Application Wizard’ to create a new project & ‘Next’ through all the prompts until you get to ‘Data Access Forms’. Select ‘Create new Form’ and provide the database format / database name. Eventually you are taken to a form where you have to specify the form layout (Master/Detail, Grid, Flexgrid etc). You will then have to provide the recordsource for the grid before it is created.
However, this is just creating a grid with SQL – there is no sub-form object like in Access. But at least this allows you to replicate views that users are familiar with in Access.
-
WSDylan Morley
AskWoody LoungerSeptember 11, 2002 at 8:04 am in reply to: Creating Word Document via Automation (Word 97 / VB6) #615841Thanks for all your suggestions, I’ll be giving each one a go…
-
WSDylan Morley
AskWoody LoungerSeptember 4, 2002 at 11:46 am in reply to: Massage Excel file from VB6.0 (VB6.0 and Excel 2000) #613989You need to automate Excel by creating an instance of the Excel.Application object. First thing to do is set a reference to Excel in your VB6 project (Project > References menu) by selecting the ‘Microsoft Excel 9.0 Object Library’.
I’ve attached a text file which is a ‘Excel wrapper’ class. Download the file, rename the file extension to .cls and add it to your project and you will be able to begin automating excel. The following is some example code on using the object…
Private Sub DoExcelAutomation()
Dim cExcel As ExcelAutomation
Set cExcel = New ExcelAutomation
cExcel.OpenExcelFile Commondialog.FileName ‘// Change this to your file name
With cExcel.ExcelApplication.ActiveSheet
‘// Change this to the specific code you wish to run over the Excel worksheet
.Columns(“I:K”).Select
.Selection.ClearContents
.Selection.Delete Shift:=xlToLeft
.Selection.Sort Key1:=Range(“I1”), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End WithSet cExcel = Nothing
End Sub
So, you could record a macro in Excel to do all the stuff you want to do to the sheet, then just copy the generated code into the VB application (place the code into the ‘With’ block in the example code, remembering to prefix all the code with a ‘.’ full stop)
-
WSDylan Morley
AskWoody LoungerClassic way to input and manipulate a text file….
Public Sub OpenTextFile(sFileName As String)
Dim sWorkString As String
‘// Open the selected file
Open sFileName For Input As #1‘// Check that the file contains at least one record
If EOF(1) = True Then
MsgBox “The selected file is empty.” & Chr$(13) & “Please return and select another file”, 16, “Data Import”
Exit Sub
End IfDo While Not EOF(1)
‘// Read the first record and check its format
Line Input #1, sWorkString‘// Now you can get each line from the text file and store it in the sWorkString variable.
‘// Add code to do what you want with the dataLoop
Close #1
End Sub
-
WSDylan Morley
AskWoody LoungerAugust 22, 2002 at 1:35 pm in reply to: Displaying Office documents in a window (VB6 / VBA Office 2000) #610695Geoff,
I dropped this into my main app and it still worked OK. My version of shdocvw.dll is 5.50.4807.2300, don’t know if this could have anything to do with it?
I pushed the app quite hard (as many forms open as possible, a couple processing data) and the documents I pointed the web browser at still opened within the VB component.
Sorry, can’t think of anything else that could be causing this…
-
WSDylan Morley
AskWoody LoungerAugust 22, 2002 at 12:06 pm in reply to: Displaying Office documents in a window (VB6 / VBA Office 2000) #610643Yeah, I just tried this in a quick test app. I’m working on a particularly large application at the moment tho, so It won’t take a minute to drop the test form into that and see if it’s behaviour changes.
My app is made out of 44 forms, 6 modules and 15 classes. It compiles to about 2MB and the process runs in memory at about 12MB (!!). Don’t know if this is comparable to you, but I’ll test it out anyway and let you know…
-
WSDylan Morley
AskWoody LoungerAugust 22, 2002 at 11:23 am in reply to: Displaying Office documents in a window (VB6 / VBA Office 2000) #610625Geoff,
I’ve tried out point 2 on my system and it seems OK. I’m using VB6 on NT4, ‘Microsoft Internet Controls’ as my component. I’ve created a web-browser object named wbMain and I’m loading the documents with the following syntax…
wbMain.Navigate2 “file://F:wordworddoc.doc
After successfully loading a word document, I’ve used the same syntax to load an Excel file and it opens in the same browser object with no problems. You say it was working fine for a while, did it simply stop working after a number of attempts? (sorry, can’t access the link to the IE forum)?
Thanks
-
WSDylan Morley
AskWoody LoungerHans,
I’ll be implementing your code as my search, I was hoping to do it in 1 line is all – lazy Monday morning coding…!!
Thanks for your response.
-
WSDylan Morley
AskWoody LoungerThis is the main section of the code…’CreateRecordset’ is just a generic function that sets the active connection and opens a recordset using the passed parameters.
Public Function UpdateGroup() As Long
Dim RS_Groups As ADODB.Recordset
Set RS_Groups = clsConnect.CreateRecordset(“tblGroups”, adOpenDynamic, adUseClient, adLockOptimistic)
If (mvarGroupID = 0) Then ‘// We are creating a new group
RS_Groups.AddNew
End If‘// Update using class properties
With RS_Groups
!Group_Name = mvarGroupName
!Parent_Group_ID = mvarParentGroup
!Active = mvarActive
.Update
UpdateGroup = !Group_ID ‘// The value of Group_ID is zero at this point
End With‘// Destroy objects
RS_Groups.Close
Set RS_Groups = NothingEnd Function
At some point after calling the ‘AddNew’, I would expect Group_ID to be the next number from the table. Yet, it remains NULL until calling update, where it changes to ZERO.
I’m using Microsoft.Jet.OLEDB.4.0 as the provider for my connection.
Thanks
-
WSDylan Morley
AskWoody LoungerThe API declare may not be correct for this platform….I use the following in my projects.
‘// Sound API
Public Const SND_SYNC = &H0
Public Const SND_ASYNC = &H1
Public Const SND_NODEFAULT = &H2
Public Const SND_LOOP = &H8
Public Const SND_NOSTOP = &H10Public Declare Function sndPlaySound Lib “winmm.dll” Alias “sndPlaySoundA” _
(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long‘ // ******************************************************************************
‘ // SUB
‘ // PlayWAVFile(sFileName As String)
‘ //
‘ // PARAMETERS
‘ // sFileName – The name of the WAV file
‘
‘ // RETURN VALUE
‘ // None
‘ //
‘ // COMPONENTS USED
‘ // {Win32 API}
‘ //
‘ // NOTES
‘ // Plays a WAV file using the Win32 API
‘ // ******************************************************************************Public Sub PlayWAVFile(sFileName As String)
Dim wFlags As String
Dim vReturnValue As Variant
Dim sPath As StringOn Error Resume Next
wFlags = (SND_ASYNC Or SND_NODEFAULT)
vReturnValue = sndPlaySound(sFileName, wFlags)End Sub
Notice the DLL name has changed in the declaration. Perhaps you need to change this?
-
WSDylan Morley
AskWoody LoungerThe best way to manipulate registry settings to create your own specific software keys is to use a class object, which I have attached (I’ve had to be sneaky and change the extension to .TXT. Simply change it back to .CLS when you download it). You can reuse this in any projects you create and your software keys will all be located in the same place.
If you look in the function ‘TransferValueEx’, you will see I have set the full key to…
sFullKey = “SOFTWAREMYPROGRAM” & App.Title & “” & sKeyName
If you change ‘MYPROGRAM’ to whatever you require, this is where all your registry settings will be stored. Here is a quick example on how to use the object to create a new string entry in the registry.
Dim cReg As New Registry
cReg.TransferValueEx REG_TRANSFER_WRITE, False, “Test”, “Test”, REG_SZ, “1”, “1”Have a look at the class to see how the different parameters are used…
-
WSDylan Morley
AskWoody LoungerAugust 6, 2002 at 9:17 am in reply to: Is it possible to get a PC Users Full Name (Access 97/NT4) #606332Perhaps you can find the users full name in the registry somewhere without using the standard ‘GetUserName’ API. I had a quick search through mine and found it in my MS Exchange settings under the following key…
HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionWindows Messaging SubsystemProfilesMS Exchange Settings13dbb0c8aa05101a9bb000aa002fc45a
Depends on your mail client whether you would have this key, but if so you could use the RegOpenKeyEx & QueryValueEx to extract the users full name. Try searching your registry to see if you can find ‘Joe Bloggs’ held anywhere…
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
.NET 8.0 Desktop Runtime (v8.0.16) – Windows x86 Installer (Awaiting moderation)
by
WSmeyerbos
42 minutes ago -
Neowin poll : What do you plan to do on Windows 10 EOS
by
Alex5723
58 minutes ago -
May 31, 2025—KB5062170 (OS Builds 22621.5415 and 22631.5415 Out-of-band
by
Alex5723
1 hour, 9 minutes ago -
Discover the Best AI Tools for Everything
by
Alex5723
10 hours, 23 minutes ago -
Edge Seems To Be Gaining Weight
by
bbearren
5 hours, 9 minutes ago -
Rufus is available from the MSFT Store
by
PL1
21 hours, 21 minutes ago -
Microsoft : Ending USB-C® Port Confusion
by
Alex5723
23 hours, 31 minutes ago -
KB5061768 update for Intel vPro processor
by
drmark
5 hours, 55 minutes ago -
Outlook 365 classic has exhausted all shared resources
by
drmark
2 hours, 7 minutes ago -
My Simple Word 2010 Macro Is Not Working
by
mbennett555
19 hours, 16 minutes ago -
Office gets current release
by
Susan Bradley
21 hours, 53 minutes ago -
FBI: Still Using One of These Old Routers? It’s Vulnerable to Hackers
by
Alex5723
2 days, 11 hours ago -
Windows AI Local Only no NPU required!
by
RetiredGeek
1 day, 20 hours ago -
Stop the OneDrive defaults
by
CWBillow
2 days, 12 hours ago -
Windows 11 Insider Preview build 27868 released to Canary
by
joep517
2 days, 22 hours ago -
X Suspends Encrypted DMs
by
Alex5723
3 days ago -
WSJ : My Robot and Me AI generated movie
by
Alex5723
3 days, 1 hour ago -
Botnet hacks 9,000+ ASUS routers to add persistent SSH backdoor
by
Alex5723
3 days, 1 hour ago -
OpenAI model sabotages shutdown code
by
Cybertooth
3 days, 2 hours ago -
Backup and access old e-mails after company e-mail address is terminated
by
M W Leijendekker
2 days, 14 hours ago -
Enabling Secureboot
by
ITguy
2 days, 21 hours ago -
Windows hosting exposes additional bugs
by
Susan Bradley
3 days, 10 hours ago -
No more rounded corners??
by
CWBillow
3 days, 6 hours ago -
Android 15 and IPV6
by
Win7and10
2 days, 19 hours ago -
KB5058405 might fail to install with recovery error 0xc0000098 in ACPI.sys
by
Susan Bradley
3 days, 22 hours ago -
T-Mobile’s T-Life App has a “Screen Recording Tool” Turned on
by
Alex5723
4 days, 1 hour ago -
Windows 11 Insider Preview Build 26100.4202 (24H2) released to Release Preview
by
joep517
3 days, 19 hours ago -
Windows Update orchestration platform to update all software
by
Alex5723
4 days, 8 hours ago -
May preview updates
by
Susan Bradley
3 days, 20 hours ago -
Microsoft releases KB5061977 Windows 11 24H2, Server 2025 emergency out of band
by
Alex5723
3 days, 11 hours ago
Recent blog posts
Key Links
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.