Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Function Calls not available

Posted on 2001-08-17
5
Medium Priority
?
357 Views
Last Modified: 2008-01-16
I am attempting to close all documents opened in the Window menu and set their Dirty property to false so that when the documents are closed the User doesn't get prompted for saving them.  We do not want them saving the merged .doc's.  

Dim numwin As Integer
Dim i As Integer
numwin = CountWindows()
If numwin <> 0 Then
    i = numwin
    While i <= 1
        WindowList i
        SetDocumentDirty 0
        i = i - 1
    Wend
End If

    Application.Quit

I am getting a Sub or Function not defined for the statement CountWindows()  Are not all the Word functions normally available in VBA for Word?  I get the same message for the WindowList function call.

Bob Scriver
0
Comment
Question by:Bob Scriver
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 6

Expert Comment

by:Triskelion
ID: 6398928
From what I can tell, CountWindows is not a function in MS Word.
0
 
LVL 6

Accepted Solution

by:
Triskelion earned 200 total points
ID: 6398931
try ActiveDocument.Windows.Count
0
 
LVL 3

Author Comment

by:Bob Scriver
ID: 6399000
Thank you.  I just found out that the Microsoft Word Developer's Kit book that I was referencing was for Word 6.0 WinWord and not for Word 97 W/VBA. Lots of great function calls but they obviously no longer exist.  The .count property will work just fine.
 

I have written the code and it seems to be working just fine.

Bob Scriver
0
 
LVL 17

Expert Comment

by:calacuccia
ID: 6399887
Hi Bob (and triskelion)

Just a little extra info,

IN Word 97 you can still use Wrd 6.0 commands, by preceding the old command by the WordBasic object.

In your case, this would be

numWin = WordBasic.CountWindows
0
 
LVL 3

Author Comment

by:Bob Scriver
ID: 6400497
Great.  Thank you for that.  There are a lot of WordBasic functions that seem interesting and I would like to try them.  Now that I realize the VBA formatting I should be able to incorporate both into my macros.  

Like I said before my expertise is with ACCESS and VBA and I was just steered a little off-center by an out-of-date book with Word 97.  

I am still struggling with another issue if you are willing to help.  

I have a template with existing bookmarks on it.  I wish to load a bookmark, caled date1 with todays date upon the opening of a new document from a template.  Then I would like to direct the focus to another bookmark, called lastname.  I want the user to be able to tab into the date1 bookmark and tab through it if the current date is acceptable or overwrite it with another date if they wish.  Could you possible answer this question for me?  I have another question on the board concerning this issue that I would give you the ACCEPTED ANSWER to if you can help me with this problem.

Bob Scriver

0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question