Word VBA >> BOOLEAN var initially FALSE?

by Rick Charnes » Fri, 23 Jul 2004 23:11:11 GMT

Just to confirm: when I first declare a boolean var --

DIM myvar AS BOOLEAN

myvar has an initial value of FALSE without my doing anything, right?


Word VBA >> BOOLEAN var initially FALSE?

by Chad DeMeyer » Sat, 24 Jul 2004 00:23:45 GMT


Correct.
Although, I've heard that it's bad programming practice not to explicitly
initialize variables.
But I've been known to neglect that step.

Regards,
Chad









Word VBA >> BOOLEAN var initially FALSE?

by Jay Freedman » Sat, 24 Jul 2004 00:24:23 GMT




Hi Rick,

Yes, that's correct. However, it costs very little to assign it explicitly
at the beginning of the macro, and could be helpful to a human reader trying
to understand the code.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org




BOOLEAN var initially FALSE?

by Howard Kaikow » Sat, 24 Jul 2004 11:44:39 GMT

Yes.

--
http://www.standards.com/ ; See Howard Kaikow's web site.






Similar Threads

1. VBA always creates linked chart even when using PasteExcelTable False, False, False in Office 2007

Hello,

I have a spreadsheet that I use to create a Word doc report that
containes a chart graph.

Using VBA, for each row in the spreadsheet, I copy the values of the
row to a separate sheet that has the chart.  The values go into the
same cells every time and the chart references those cells.  After
copying the values over to the sheet with the chart on it, the chart
is selected and then pasted into a new page in the Word document.

Then the next row of values is copied over to the chart sheet and the
new chart is copied and inserted into a new page in the word doc.

As you can see, I don't want that chart in Word to be linked to Excel
because the values that the chart references are being changed every
loop through the rows in excel.

Here is the code that does the copy and paste - this worked perfectly
in office 2003

Range("A1:I49").Copy
appWD.Selection.Paste
appWD.Selection.InsertBreak Type:=wdSectionBreakNextPage

However, in 2007, this results in a linked chart so that after the
macro is done, all charts on all pages of the word doc display the
same values - the values of the last row in Excel.

I have tried this code and found that the results are exactly the
same:

Range("A1:I49").Copy
appWD.Selection.PasteExcelTable False, False, False
appWD.Selection.InsertBreak Type:=wdSectionBreakNextPage

This makes sense but how do i paste it so that the chart itself is not
linked?

I could copy as picture, but the quality of the result is not as good
- it is just for printing though so I suppose I could go that way if I
have to.

Thanks!

Matt

2. While xyz = FALSE OR While abc = FALSE

3. Combo boxes initially highlighted

I have five comboboxes each has a item listed populated by hand in the IDE.
Each has the text property bound to a text field in the database.  When I
initially fill the dataset and display the page all of these combo boxes
display the correct data, but all of them are highlighted as if they have
focus.

If I click in on and then click another control the highlight goes away.  I
have a tabbed interface and If I navigate to another tab and back the
highlights are gone from all of the combo boxes.

How can I get them to initially display the data not highlighted?

Gary


4. SendKeys method only works when IE initially closed

5. A97 query not working initially...

I am using VB6 and ADO with an Access97 database.  There is a backend
database with only tables and a frontend datebase with queries and links to
the backend tables.

When I use a command object to open a parameterized query as
adLockOptimistic, a couple of the queries generate an error.  The error
number is -2147467259, the error description is "Invalid operation.".  The
error source is Microsoft JET Database Engine.  If I then open the frontend
database, run the query and close it works ok thru ADO.  But since I often
relink the frontend between test data and production data the problem recurs
each time.  What is wrong and how can I fix it?


6. Wrong kind of document comes up initially...

7. Problem encountered with Word initially.

Wife (Gail) is a teacher-was trying to write letter to 
students' parents and could not write the normal 
salutation: "Dear Parents," after typing the comma and 
hitting the return key for next line, Word stopped 
operating and error message appeared:- Microsoft Word has 
encountered a problem and needs to close. We are sorry for 
the inconvenience. Note: if comma ommitted, letter can 
write ok and comma can go in later with no troubles.

The same type of message appears when I try to "show 
office assistant" in both Word & Exel.Also in Publisher 
and i suspect in all applications. Also happens when 
trying to run letter wizard. 

I am running Office 2000 on Win XP and have only had it a 
short time. We also have a laptop running Word 2000 from 
Works suite on Win ME. The laptop operates  normally and 
also shows office assistant.

I have been regularly updating both office and Windows 
from update links. I have also tried re-
installing/repairing Office to no avail.

Word compatability in properties is all unticked.
Office assistant on Offpro Disk-2 has been changed to run 
from my computer.

Still no good. I have never encountered this with old 
Win95 & Off97 set up I had previously.

Is there something I have missed? I'm no guru but I can 
find my way around the computer. I have gone as far as I 
know and request ideas from someone who may have seen this 
occur.

Thank you kindly,
Peter Ilott

8. Double-click not recognized initially. - Microsoft Office