"Curing" Word's List Numbering With VBA
Hey everyone, I am using VBA to generate documents with lists that must then be cut and pasted into another Word document (there is NO way aroud this). Unfortunately, some of these lists are nested and so cutting-and-pasting often screws them up, and then I lose all the time I saved by using a VBA form
Soo I came across a very helpful and extensive website:
http://word.mvps.org/FAQs/Numbering/WordsNumberingExplained.htm
which within it has a link to another article, "How to cure Word's List Numbering with a dose of VBA", http://word.mvps.org/FAQs/Numbering/CureListNumbering.htm , BUT THE LINK DOESN'T WORK. It hasn't worked every time I've tried in the last couple of months, even after emailing the webmaster.
So rather than me banging my head on my desk and continually hitting refresh on that site, does someone have a copy of the information contained there or can someone explain how it is done? I will be eternally grateful!
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
- Getting The File "Type" Descriptions (i.e., "doc" = "Microsoft Word Docume
- Changing The "title" Of A VB Created Word Doc From "Document1" 2 "BadgerBai
- If I Use "SaveSetting App.Title, "Settings", "Font", "001122"" - Save Date In The Registry, Where Ca
- Reading "Numbering" From VB(file Parser)
- How To Export An "image File" And "MSFlexGrid" To A Word Document
- How To Remove Word Document Metadata "author" And "Last Saved By"
- Change "Page Numbering"
- Solution> Error: """"&&H8007007E (-2147024770) The Specified Module Cannot Be Found"""
- Method "SaveAs" Or "Save" Of Object "Excel.Workbook" Does Not Work.
- Grant "List Folder Contents" Instead Of "Read" Permissions On Folder
- How To Replace "Apple" With "Banana" In A String That Contains "Orange" In A TXT File
- Data1.RecordSource = "select * From Salary Where 姓名 Like " + S + " " * ""
- How To Change Boolean Field From Displaying "0" And "-1" To "Yes" And "No"
- MS Word - "Mailto" And "SendMail"
- How Can I Check If A Word Is Between "<" And ">" In A String?
- Extract Local Names For "OK", "Cancel" And "Apply"
- <input Type="submit" Name="op-savefile" Value="Save"> - How To S
- Disabling "wake Up", "sleep" && "power" Button
- Pleez, Read This!!! Matter Important! "Printing In "DOS Mode" Using "Shell" -not Happening, I Wonder
- Resubmitting: "BeginTrans" , "CommitTrans" And "Rollback With Data Environments
- Can Someone Guide Me On How To "PUT" A "CHECKBOX" Inside A "Datagrid" For VB6.0?
- Combobox Help """""""""""""'Urgent"""""""&&quo
- "BeginTrans" , "CommitTrans" And "Rollback With Data Environments
- Open "Read Only" Word Doc As In "Non Read Only" Mode
-
Export Table From MS Access To Outlooks Contacts "Standard Field" - With Conatct Item "Notes"
- Inverted Commas In String "etc" && Variable && """
- A "word" About Changing Page Orientation In Word When Using VB6
- Creating Program "item" In Existing Start Menu "group"
- How To Change All Cells Format Type From "General" To "Text" Using VB Code
- How To Reach Each File In A Folder In Order? With "FileSystemObject" - "Files" Class.
- Emulating The "APPLY" Button Within The Appearance Options "Refresh The New Settings"
- Msgbox "text", VbOKOnly, "Title" Remove X In Upper Right Corner
- A Stupid Problem: "Error Accessing The System Registry" ("Solved") Thank You
- How To Make Appear A List Of Options From A Function (like "true False" Of Booleans)
- "Not In DataCombo List " Event To Save The Data That Has Been Input. I Have The Code
- How Do I Insert The "Currenty Active Users" List On My Forums Page?
- How Do You Search Outlook "Global Address List" By User Id. From Excel
- How 2 "insert" Items In A Combobox List (Works Like A Charm - Thanks!)
- MapI "Global Address List" Read Telephonenumbers
- How To Enable "list Folder Contents" Permission Programmatically?
- Finding Details From Outlook "Global Address List", Searching By Login Id
- EnumWindows AddressOf EnumWindowsProc, 0 "Syntax Error"</title>
<script Type="text/javascript">
<!--
Function PrintTags() {
Var Curr=document.getElementById('vB_Editor_QR_textarea').value;
- Toolbar, "Macro Combobox", Or Dropdown List ?
- Compile Error "expected List Or Separator"
- Send "ItemClick" Message To The List View
- Is There VB "debug" Or Something That Will List All Required External References???
- List.Clear Not Clearing When I Use "intStart As Long"
- Why Can't Create "Excel.Application" Object Using "CreateObject" Function
- VBcode In Excel For "print" And "Exit" Command Button
Getting The File "Type" Descriptions (i.e., "doc" = "Microsoft Word Docume
Hello there,
I am creating an Explorer-type Listview to display the files in a directory, and one piece of info I need to know how to obtain is the file "type" (i.e., "doc" = "Mircosoft Word Document", "xls" = "Microsoft Excel Worksheet", etc.). Is there an API, or does anyone have a technique to do this? Thanks.
Changing The "title" Of A VB Created Word Doc From "Document1" 2 "BadgerBai
Ok, when I create a new word doc it automatically takes on the name "DocumentX", where X is a number greater than 1.
What I want to do is change this by using something like:
VB Code:
Dim objWoof As New Word.ApplicationDim objGrowl As Word.Document Set objGrowl = objWoof.Documents.Add objGrowl.[What Property] = "Badger Baiters R Us"
Is this possible?
Oh, and b4 anyone mentions it, I do NOT want to save it, that is NOT an option...just getting that out the way now
Rarararrrrrrrrr
Woka
Reading "Numbering" From VB(file Parser)
Hello.. I have this project where i have to read tables from a word document. The problem is that "Numbering" is used on one of the columns to mark the row number, and I can't figure out how to read that. Can anybody help.
ps: I might have other questions further on but this is all I can think of right now..
10x
How To Export An "image File" And "MSFlexGrid" To A Word Document
I need to output an image file and a table (MSFlexGrid) to WORD, anyone can suggest how to do ?
I use the following to output text fields:
========================================================Private Sub cmdPrtProductionSheet_Click()
Dim objWORD As New Word.Application
Dim objDoc As New Word.Document
Set objDoc = objWORD.Documents.Open("C:PPSheet.doc")
objDoc.FormFields.Item("clientcode").Range = strClientCode
objDoc.FormFields.Item("factorycode").Range = txtFactoryCode
objDoc.FormFields.Item("PPNO").Range = strPPNO
objDoc.FormFields.Item("PDate").Range = strIDate
objDoc.FormFields.Item("EDate").Range = strEDate
objDoc.FormFields.Item("ContactNo").Range = strSONO
objDoc.FormFields.Item("StyleCode").Range = txtPPStyleCode
objDoc.FormFields.Item("BulkQty").Range = txtPPBulkQty
objDoc.FormFields.Item("Quota").Range = txtPPQuota
objDoc.FormFields.Item("description").Range = txtPPStyleName
'objDoc.FormFields.Item("imagefile").Range = LoadPicture(iFile)
objDoc.SaveAs ("C:PPSheet_" & strPPNO & ".doc")
objDoc.Close
Set objDoc = Nothing
Set objWORD = Nothing
End Sub
Thank you in advance
How To Remove Word Document Metadata "author" And "Last Saved By"
hi all
I want to remove meta data of a ms word document.
I m able to do that. but my problem is as i save it after removing meta data value, its again saving the time and author name, that is me as user. so i do not want to keep author name and last saved by and time.
and one more question is
can i get meta data without opening (Programmaticaly) word document.
please help
meena
Change "Page Numbering"
Hi,
I need to create a Word Document that starts the counting of the number of pages in 2, but i can´t figure it out how i can do this using VBA.
thanks in advance
Miguel Carvalho
Method "SaveAs" Or "Save" Of Object "Excel.Workbook" Does Not Work.
Hi people.
I did for a long time a program that uses excel automation, so that from a template will create a final file with some data pulled from the database (with ADO). At the end and when the Excel file is ready to be saved I got in a couple of computers some problems. In the whole LAN have XP, but in these 2 computers we have SP2. I have checked the rights and are OK (I have even tried to save the Workbook under the Temp folder and also the same problem).
Working with Office 2003 (SP1).
I have searched in internet about any bugs but I don´t find anything.
Any ideas.
Thanks for your time
Jaime
Grant "List Folder Contents" Instead Of "Read" Permissions On Folder
We can grant a user to "List Folder Contents" by manually editting the Security settings, but if we want to do so with CACLS command, we can only grant "Read" (minimum) permissions to the user.
e.g.
C:>cacls c: est /T /E /C /P Guests:R
How can we grant a user to "List Folder Contents" programmatically?
How To Change Boolean Field From Displaying "0" And "-1" To "Yes" And "No"
Hey there,
I have a data report, which displays a few fields from an Access table, one which is a boolean. At the moment if the boolean value is True, then on the data report it displays "-1", and if False "0".
How can I change this so it displays "Yes" if true and "No" if False?
Would be really grateful for any help.
Thanks.
MS Word - "Mailto" And "SendMail"
I have a Word form that I would like to email to various recipients.
I would like the recipients to complete the form and then click a submit button to open Outlook and return the completed form to me.
Using "Mailto:" I can get my email address automatically entered but not the attachment.
Using "ActiveDocument.SendMail" the form is attached but not my email address.
How can I get both entered?
How Can I Check If A Word Is Between "<" And ">" In A String?
hello,
I have a string with words and signs in it.
the string is something like this:
"<one two three> four five six"
how can I check if a word is between "<" and ">"?
in the example, one is between "<" and ">" ,
two is between "<" and ">"
and three is between "<" and ">" .
thanks
Extract Local Names For "OK", "Cancel" And "Apply"
Hi!
I noticed that some programs written in C++ have an English language, but the captions of the buttons "OK", "Cancel" and "Apply" are in German, Swedish or whatever localized Windows version the user utilizes. Any idea how to obtain the captions of those buttons in VB? The only method which comes into my mind is to get the locale ID and have an array with strings for the the various language versions, but I doubt that those programs do it in that way.
Regards,
Sebastian
Pleez, Read This!!! Matter Important! "Printing In "DOS Mode" Using "Shell" -not Happening, I Wonder
Hi
[I had to repost it since I have not received any replies for my earlier post]
I have a problem.
Following is the code :
Shell("c:windowscommand.com /c type " & App.path & "matrix.txt >prn")
where App.path is C:XYZ
when the above line is executed, the contents of "matrix.txt" is not printed on the printer. Instead, control just passes on to the next line.
So, to find out why, I modified the line thus.
Shell("c:windowscommand.com /K")
The above command takes me to the "command prompt". Here, when I give the command "type c:xyzmatrix.txt >prn", which is what the vbcode does, I get the message "file creation error".
So, I have identified the problem. Can anyone tell me why this "File creation error" occurs, And how to solve the problem?
Thanks for reading through.
Resubmitting: "BeginTrans" , "CommitTrans" And "Rollback With Data Environments
----- Original Message -----
From: shankar [ babu ]
To: visualbasic-l@OpenITx.com
Sent: Wednesday, February 26, 2003 12:24 PM
Subject: "BeginTrans" , "CommitTrans" and "Rollback with dataenvironments
hello everybody,
I am using data enviroment designer in my project.
I am getting error while using
"BeginTrans" , "CommitTrans" and "Rollback"
of the DataEnvironment 's connection properties
kindly let me know the solution
thanks in advance
bye
shankar
Combobox Help """""""""""""'Urgent"""""""&&quo
Hi Guys,,,,,,
This may be the stupid way.But i need this.................
I am using combobox in my form. I set the style to Dropdown combo.
Here we can exter text in combobox b'coz of the style Dropdown combo.
But i don't want to allow user to enter ......allowed only to select.....
For that i can set the style to Dropdownlist.
But i don't want this style. B'coz i can't clear the text at run time.
Tell me if dropdown combo means, User shouldn't enter at runtime
Tell me if dropdown list means, how to clear the text at runtime...
Pls help me out.....Urgent
sangeetha
Open "Read Only" Word Doc As In "Non Read Only" Mode
I have a bunch of "Read Only" word documents that the user has to choose from to open and edit. Since they are read only, upon opening the file I need to change the mode so the document can be saved with the same title. I found an entry by doing a search in this forum but I can't get it to work. This is the code I found.
Code:
wdApp.Documents.Open filename:="C: est.doc", ReadOnly:=True
This is how I am trying to use it with my code. It is giving me the following compiler error:
Expected: end of statement.
Code:
Dim objWdApp As Word.Application
Dim objWdDoc As Word.Document
Dim objWdRange As Word.Range
Set objWdApp = New Word.Application
Set objWdDoc = objWdApp.Documents.Open(DocPath), ReadOnly:=True
Thanks for any help you can give!
gfolz
Inverted Commas In String "etc" && Variable && """
I need to include a double inverted comma in a string, here's some more detail...
MsgTitle = "RaceControl 2003"
MsgText = "Enter password."
rcvarValueString1 = InputBox(MsgText, MsgTitle)
rcvarValueString2 = "MS Access;PWD=" & rcvarValueString1 & """
Set dbRacecontrol = OpenDatabase("RaceControl2003.mdb", False, False, rcvarValueString1)
The last part of the Set statement needs to read "MSAccess;PWD=password" including the double inverted commas (where password is the password for the database). However, I want to make the user type in the password... I suppose what i've done so far is correct, but I don't know how to include the double inverted commas in the variable rcvarValueString2. The rest of the Set statement is definitely correct.
Thanks in advance,
Mat
A "word" About Changing Page Orientation In Word When Using VB6
I recently wrote a subroutine package to allow me to generate Word documents on the fly. When using it, I came across a problem that drove me crazy for a while - I am posting this to save others the headache I had.
The problem was that occasionally the top, bottom and side margins went "screwy." Example: even though the top and bottom margins were set to 1 inch and .5 inches respectively, and the right and left margins were both set to .5 inches, when the document was generated, the right margin was 1 inch and the rest .5 inches. In most cases, it worked properly, but occasionally I got this strange result.
The issues is that if you are going to change the page orientation to landscape from portrait (or visa-versa), you need to do it BEFORE you change or set the margins. While this is probably not technically accurate, the following visualization explains what is happening:
Assume you have a portrait oriented document. When you set the top, bottom, right and left margins (or any combo thereof), everything is okay. If you then change the document orientation to landscape, its almost as if the page its rotated 90 degrees (rather than shortened and widened). The two sides rotate around and become the top and bottom and the original top and bottom have rotated to become the sides. The margins STAY attached to their original top and bottom (which are now sides) and boths sides (which are now the top and bottom) after the rotation - the result is you get "screwy" margins.
Because of the combinations of changing margins and orientations in different orders, it took me a while to figure it out. Simply changing the orientation first fixes the issue.
I hope this makes sense and helps ....
Jim
Creating Program "item" In Existing Start Menu "group"
Hi all,
I'm finally at the stage of packaging my application for distibution here at work. When it installs, I don't want it to create a new group in the start menu rather I want to ADD it to an existing group. All of our essential programs go in to a group called "Desktop Applications". During the P&DW, I created a new Group under Programs called "Desktop Applications" and put the program item under that group thinking it would recognize it as an existing group and just add it. Well, apparently I did something wrong because it doesn't add it to this group, nor does it add it anywere else.
Does anyone know how to do this?
How To Change All Cells Format Type From "General" To "Text" Using VB Code
Hi Guys,
I am new to VBA. If you see my code below, it gets the name from user to insert a new sheet into existing work book. Now, when I create this new worksheet, I want to change their all cells format from "General" to "Text". In that case, whatever I add it is saved as "text" not number or general.
How can I do that? Please help me.
Code:
On Error Resume Next
Dim count As Integer
If txtNewSheet.Text <> "" Then
wbDpiFavorites.Sheets.Add
' Get the sheet with the name selected in the Sheet combo box.
Set shtFavorites = wbDpiFavorites.Sheets.Item(1)
shtFavorites.Name = txtNewSheet.Text
cmbSheet.AddItem shtFavorites.Name
cmbSheet.ListIndex = cmbSheet.ListCount - 1
wbDpiFavorites.Save
Set shtFavorites = Nothing
End If
How To Reach Each File In A Folder In Order? With "FileSystemObject" - "Files" Class.
I know that I can reach any file(or filename) by using FileBox control with
Code:
'I can choose any file with its index. The Files are sorted by their names
File1.List(FileIndex)
I want to do the same without using FileBox control, else I tried to reach Files
with
Code:
Dim fso As New FileSystemObject, fil1 As File, fol1 As Folder, fc As Files
Set fc = fso.GetFolder(sFolderPath).Files
MsgBox fc.Count
'Nothing wrong up to here
'but this line gives error
MsgBox fc(1).name
I figured it out that
Code:
Msgbox fc(index) 'is wrong
Msgbox fc(key) 'this is the right one
So what is key here?
And Is it possible to reach each file with in order(as sorted by names)
(ex: I want to access the 6. file or 3. file) with FileSystem Object?
Ofcourse any other ideas will be wellcome.
Emulating The "APPLY" Button Within The Appearance Options "Refresh The New Settings"
Hi Guys,
I'm needing some help with this one. I've got a copy of the HKCUControl Panel hive and need to apply this to the registry and then "apply" the changes. The problem lies with "refreshing" the registry so that the changes apply.
Here's an example:
1. Open Regedit and change the following key = HKCUControl PanelColorsBackground to 0 0 0 (black, or any choice of color!) and close regedit.
2. To apply the changes, a user needs to log off and then back in. This is no good.
I've tried running TSKILL explorer.exe but this does not help either..
Any help would be great.
A Stupid Problem: "Error Accessing The System Registry" ("Solved") Thank You
This is a very silly problem. I tried to have a look of References from Project dropdown menu, it returned a critical error:
"Error Accessing the system registry".
I reinstalled VB6 but it seems that the problem still exists. Anybody please tell me how to solve the problem.
thanks in advance
Edited by - kenyiwei on 5/6/2004 2:07:51 AM
How To Make Appear A List Of Options From A Function (like "true False" Of Booleans)
When we use a Function like Msgbox we see that appear a "list" or cascade "list" of options to select like "Information, Warning, OKCancel, etc." or other example is when we use a boolean variable. When we asign the value appears a little cascade with de "True, False" options...
My question is What can I do in the elaboration of the Function (any Function) to make appear the options I need in a cascade...
Please...Help...
Luis
"Not In DataCombo List " Event To Save The Data That Has Been Input. I Have The Code
...i have the code for it in access
but i am having some what, excessive, problems in doing the same thing in visual basic.
HEre is my codes which i use to do it in access.
as you can see, every field wich i use it for just calls a chunk of script from a Module that i have.
Here is the code i put for each field that i want new data input from a user to be input into the combo so that it now becomes data inside the combo. like memory..:
Private Sub RegionID_NotInList(NewData As String, Response As Integer)
Call pfNotInList(NewData, Response, Me)
End Sub
and here is the module that the script above refers to:
Option Compare Database
Option Explicit
'The functions here require a reference to the Microsoft DAO 3.x Object Library.
'From the VB Toolbar above, select Tools - References.
'Find and check Microsoft DAO 3.5x (Access 97) or 3.6 (Access 2000/2002) Object library, and move it in to 3rd or 4th 'priority'.
'Now select Debug - Compile. This must compile completely.
Global glStrFName As String, glfPermit As Boolean, gllgUserID As Long
Public Function pflgReturnUserID() As Long
On Error Resume Next
pflgReturnUserID = gllgUserID
End Function
Function IsLoaded(ByVal strFormName As String) As Integer
Const conObjStateClosed = 0
Const conDesignView = 0
If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <> conObjStateClosed Then
If Forms(strFormName).CurrentView <> conDesignView Then IsLoaded = True
End If
End Function
Public Function pfNotInList(strValue As String, intResponse As Integer, sFrmName As Form)
Dim Rs1 As Recordset
Dim frm As Form
Dim ctrl As Control
Dim strTable As String
Dim strField As String
On Error GoTo ProcErr
Set frm = sFrmName
Set ctrl = frm.ActiveControl
strTable = ctrl.RowSource
Set Rs1 = pfDbDb.OpenRecordset(strTable)
strField = Rs1.Fields(1).Name
Set Rs1 = pfDbDb.OpenRecordset(strTable)
Rs1.AddNew
Rs1.Fields(strField) = strValue
Rs1.Update
Rs1.MoveLast
Rs1.Close
Set Rs1 = Nothing
intResponse = acDataErrAdded
ProcExit:
Exit Function
ProcErr:
MsgBox Err.Number & " " & Err.Description, vbInformation, "Not in list error."
Resume ProcExit
End Function
Public Function pfClose(frm As Form)
On Error Resume Next
DoCmd.Close acForm, frm.Name
End Function
Public Function pfDbDb() As Database
On Error Resume Next
Static DB As Database
Dim strName As String
strName = DB.Name
If Err.Number <> 0 Then
Set DB = CurrentDb()
End If
Set pfDbDb = DB
End Function
Function GetCalc()
On Error Resume Next
Call Shell("calc.exe", 1)
End Function
How Do I Insert The "Currenty Active Users" List On My Forums Page?
This is the first of a few questions I have about editing our vBoard:
How do I Insert the "Currenty Active users" List on my Forums Page?
I do not know why it is not there right now but I would like to insert it at the bottom of the forums home area.
I am working with a programmer on this site (hit my home button below to take a look). I am in charge of making the site as good as it can be for the users. I make the graphics and do all the research. he makes all the major changes.
I am essentially the project because he is very busy elsewhere so I need any help that is provided to be BabySteps please.
Thanx!
How Do You Search Outlook "Global Address List" By User Id. From Excel
Hi, hope someone can help with this, feel I am so close yet so far away from finding the answer.
I have a list of user logon ids, which are basically the pay numbers of staff in our team (1,200 people). When you add the user logon id in the "To..." box of an email this changes to the users email address.
What I want to do is use the user login id to search the "Global Address list" then automatically pull through Email address, First name, Surname and building address details etc into our Staff, Excel 2000 spreadsheet.
I have searched Outlook Guidance and have found how to find "CurrentUser" details, how to display all members in a Personal Address list and how to find contact details from a Contacts Folder but I'm not yet experienced enough to pull this information together to get the information I want(will get there within a month or two)
How 2 "insert" Items In A Combobox List (Works Like A Charm - Thanks!)
When filling a list in a combobox, new items go at the end of the list. Are there any combobox properties which allow me to insert new items at the beginning of the list.
I can write code to down load the list contents, clear the list and then reload the items in reverse order. Are there easier ways to accomplish this?
I tried searching but was unable to phrase a question which gave any results.
As always, any help is greatly appreciated.
jj2
Finding Details From Outlook "Global Address List", Searching By Login Id
Hi all, Not sure this is the right forum but I haven't had much luck in the VBA forum and the question seems to fit in with questions posted here.
I have a list of user logon ids, which are basically the pay numbers of staff in our team (1,200 people). When you add the user logon id in the "To..." box of an email this changes to the users email address.
What I want to do is use the user login id to search the Outlook "Global Address list" then pull through Email address, First name, Surname and building address details etc into our Staffing, Excel 2000 spreadsheet.
I have searched Outlook Guidance and have found how to find "CurrentUser" details, how to display all members in a Personal Address list and how to find contact details from a Contacts Folder but am struggling to pull this information together to get the information I want(will get there within a month or two).
If you need further information let me know, any help much appreciated.
Rob.
EnumWindows AddressOf EnumWindowsProc, 0 "Syntax Error"</title>
<script Type="text/javascript">
<!--
Function PrintTags() {
Var Curr=document.getElementById('vB_Editor_QR_textarea').value;
I get "Syntax Error" when i put this code in to a button. Whats wrong?
EnumWindows AddressOf EnumWindowsProc, 0
______________________________________________________________________
Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
Declare Function EnumWindows Lib "user32.dll" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
Public Function EnumWindowsProc(ByVal hwnd As Long, ByVal lParam As Long) As Long
Dim Length As Long
Dim sName As String
Dim Temp As String
Static iCount As Integer
iCount = iCount + 1
Length = GetWindowTextLength(hwnd) + 1
If Length > 1 Then
sName = Space(Length)
GetWindowText hwnd, sName, Length
If Left(sName, Length - 1) Like "Order*" Then MsgBox "window found!"
End If
EnumWindowsProc = 1
End Function
Toolbar, "Macro Combobox", Or Dropdown List ?
I imagine there's a way to do this in VB, but I don't have VB only Office2k.
I have several custom toolbars with many macro buttons for differents repetitive tasks. On Tuesday (reports day) I use my Tuesday macrobar.....etc...
Is there a way to create a Combobox linked to a toolbar where I list all my macro's, dropdown the menu, select a macro.... and it runs ?
The toolbar scheme is good, but I'm running outa button faces and the "mouse hover" to see the "alt text" of the button is a bit slow.
I suspect the direct answer is, NO.. however, any ideas are greatly appreciated.
Compile Error "expected List Or Separator"
I get a compile error at the very end of this line...seem to be missing a bracket or quotation marks but its driving me insane!! Any help??
strsql = "INSERT INTO tbl_headerrecord (recordid,acno,awbno,shipdt,commitdt,committime,exccode,excprocessid,ref,custqual,formid,trackid,shi ppername,shipperco,shippercity,shipperst,shipperzip,shipperctry,recname,recco,recaddr,reccity,recsta te,reczip,recctry,servicecode,invoice,totcharge,totqty,totweight,declaredvalue,codflag)"
VALUES (" & int_recordid & "," & int_acno & "," & int_awbno & "," & date_shipdt & "," & date_commitdt & "," & date_committime & "," & str_excode & "," & str_excprocessid & "," & str_ref & "," str_custqual & "," & str_formid & "," & str_trackid & "," & str_shippername & "," & str_shipperco & "," & str_shipperaddr & "," & str_shippercity & _
& "," & str_shipperst & "," & str_shipperzip & "," & str_recname & "," & str_recco & "," & str_recaddr & "," & str_reccity & "," & str_recstate & "," & str_reczip & "," & str_rectry & 2," & str_servicecode & "," & str_invoice & "," & str_totcharge & "," & str_totqty & "," & str_toweight & "," & str_declaredvalue & "," & str_oversizeqty & "," & str_codflag & _
& "," & str_danggoods & "," & str_filler & "," & str_received & ")"
Send "ItemClick" Message To The List View
How do I send the "ItemClick" message to the list view through code?
I am selecting a specific item in list view, but It does not call the "ItemClick" or "Click" event unless I click with the mouse or use the keyboard.
Is There VB "debug" Or Something That Will List All Required External References???
Let me start by saying that I am a relative VB novice and am not the most efficient or structured programmer around or I would not have this problem. Anyway, I have a very large project which uses numerous references and components. Over time, I’ve had a tendency to add some of these references/components in order to see if it was needed for my application. For example, the DBGRID ocx file needs to be added to your project before you can use the DBGRID control. Even though a particular reference or component may not have been needed for a specific problem I may have been having while coding, I may have inadvertently left the reference/component turned on. Now, when it comes time to distribute my project to other platforms, I’d rather not have to port a whole bunch of unnecessary ref/com files. The only way I know how to check to see if one of these files is actually necessary is successively remove each of these ref/com and rerun the code. I would rather not have to this since it will take forever to check that everything in the entire application is still functioning properly. Is there any “debugging” capability in VB that would list all the external references that are necessary for the entire code??? Thanks very much in advance.
List.Clear Not Clearing When I Use "intStart As Long"
Here is my full code, I changed "intStart As Long" and "intEnd As Long" to Long instead of Integer because of an Overflow error (they exceeded 32600 characters or whatever) Now My list1.Clear does not clear the listbox, yet it did when the two Variables were dimed as Integers could anyone explain to me why this is so?
Code:Option Explicit
Dim strText As String, strProfile As String
Private Sub cmdLoadProfiles_Click()
If List1 <> "" Then
List1.Clear
End If
Inet1.Execute "Http://www.nutrinopets.com/stats.php", "Get"
Dim intStart As Long
Dim intEnd As Long
Dim strStartTag As String
Dim strEndTag As String
Dim GetText As String
Dim strUsers() As String
Dim blnDimmed As Boolean
strStartTag = "<font color=black size=2>"
strEndTag = "<"
intStart = InStr(1, strText, strStartTag, vbTextCompare)
If intStart Then
Do
intStart = intStart + Len(strStartTag)
intEnd = InStr(intStart + 1, strText, strEndTag, vbTextCompare)
GetText = Mid(strText, intStart, intEnd - intStart)
If Not blnDimmed Then
ReDim strUsers(0)
strUsers(0) = GetText
blnDimmed = True
Else
ReDim Preserve strUsers(UBound(strUsers) + 1)
strUsers(UBound(strUsers)) = GetText
List1.AddItem GetText
End If
intStart = InStr(intEnd + 1, strText, strStartTag, vbTextCompare)
Loop Until intStart = 0
End If
End Sub
Private Sub Inet1_StateChanged(ByVal State As Integer)
Dim vtData As Variant ' Data variable.
Dim intfile As Integer
intfile = 0
Select Case State
Case icResponseCompleted ' 12
vtData = Inet1.GetChunk(1024, icString)
Do While LenB(vtData) > 0
strText = strText & vtData
vtData = Inet1.GetChunk(1024, icString)
DoEvents
Loop
strText = strText & vtData
Text1.Text = Replace(strText, vbLf, vbCrLf)
End Select
End Sub
Private Sub List1_DblClick()
strProfile = List1.Text
End Sub
[/vb]
Why Can't Create "Excel.Application" Object Using "CreateObject" Function
Hi there,
I try to create an "Excel.Application" object using CreateObject function, I got "nothing" from the return variable without any error messages, but It works well on another machine that it has same environment settings(include same references setting) on those 2 machine: Win2k/Sp4, VB6/Sp5, Mdac_type2.7, the following is source code snippet:
Public appWorld As Excel.Application
Public wbWorld As Excel.Workbook
Sub Setup()
On Error Resume Next 'ignore errors
Set appWorld = GetObject(, "Excel.Application")
If Err.Number <> 0 Then
Set appWorld = CreateObject("Excel.Application") 'run it
End If
Err.Clear
End Sub
I got "nothing" from "appWorld", even I remark all of error handle lines, the same result I got, pls help,thanks!
ps: you could reply me to : frankie@sompojapan.com.hk
VBcode In Excel For "print" And "Exit" Command Button
I am a new face here, I wonder is there any one could help me to solve the problem by using vb.
I add two command buttons in excel, one for print the document, another one for EXIT the application,but I could not find out the VB source code of doing them.
Hope someone can help me!
|