Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / December 2004

Tip: Looking for answers? Try searching our database.

WordBasic call CountMacros always returns 3

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Uday - 13 Dec 2004 09:57 GMT
I am working on application that uses "WordBasic" method calls.
One of the call it uses is "CountMacros".

I invoke the application with a word document that has macros "Macro1" and
"Macro2" as part of normal.dot template to perform some functionality.

Now the "CountMacros" call should return 5. But it doesnot do so.
I checked the macro names, it lists "ThisDocument", "NewMacros" and
"Module1" as the only macros available.

I am able to view as well as use the macros "Macro1" and "Macro2" in the
word document manually but not programatically.

I cannot change the "WordBasic" calls.

Can anyone help me out with reasons for such  behavior? OR
Am I doing something wrong? OR
Do I need to do anything else to get the macros in my program?

Thanks in advance.
Jonathan West - 13 Dec 2004 11:52 GMT
Hi Uday,

The behaviour od this changed when Word went from WordBasic to VBA in Word
97. WordBasic.CountMacros now counts modules, not macros.

I'm not aware of any reliable way of counting macros.

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup

>I am working on application that uses "WordBasic" method calls.
> One of the call it uses is "CountMacros".
[quoted text clipped - 16 lines]
>
> Thanks in advance.
Uday - 13 Dec 2004 13:09 GMT
Hi Jonathan,

  Thank you for the information.

  Where can I get such information regarding "WordBasic" calls and its
present functionality? Because my clients application code uses a lot of
"WordBasic" calls and the breaks when tested with Office > 97.
                                    OR
  Where can I find information regarding equivalent calls in VBA.?

Regards,
Uday.

> Hi Uday,
>
[quoted text clipped - 23 lines]
> >
> > Thanks in advance.
Peter - 13 Dec 2004 17:50 GMT
Not to steal Jonathan's thunder, but I've done quite a bit of WordBasic conversion recently and I found the following MSDN page that lists WordBasic-to-VBA conversions to be quite helpful:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbawd10/html/wo
howWordBasicEquivalents.asp


Watch for line breaks.

IIRC, I found that URL from w/in VBA help in Word.  I think I hit F1 while highlighting a WordBasic statement, and got to the URL a couple of steps later.

hth,

-Peter

> Hi Jonathan,
>
[quoted text clipped - 15 lines]
> >
> > I'm not aware of any reliable way of counting macros.
Helmut Weber - 13 Dec 2004 18:00 GMT
Hi Uday,

there is plenty of information in the VBA-Help.
Just search help for "Visual Basic".

Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/
Uday - 14 Dec 2004 04:23 GMT
Hi,

  Thank you for the answers.

  I shall try out at the conversion process and get back if anthing in need.

Regards,
Uday.

> Hi Uday,
>
[quoted text clipped - 6 lines]
> Word XP, Win 98
> http://word.mvps.org/
Howard Kaikow - 15 Dec 2004 05:43 GMT
See http://www.standards.com/index.html?WordBasic2VBA

Signature

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

> Hi Jonathan,
>
[quoted text clipped - 36 lines]
> > >
> > > Thanks in advance.
Uday - 15 Dec 2004 11:03 GMT
Thank you, Howard kaikow.

> See http://www.standards.com/index.html?WordBasic2VBA
>
[quoted text clipped - 41 lines]
> > > >
> > > > Thanks in advance.
Jonathan West - 15 Dec 2004 15:09 GMT
Hi Uday

> Hi Jonathan,
>
[quoted text clipped - 3 lines]
> present functionality? Because my clients application code uses a lot of
> "WordBasic" calls and the breaks when tested with Office > 97.

Take a look here

Most of the WordBasic methods are simply the old WordBasic commands
>                                     OR
>   Where can I find information regarding equivalent calls in VBA.?
[quoted text clipped - 32 lines]
>> >
>> > Thanks in advance.
Jonathan West - 15 Dec 2004 15:13 GMT
> Hi Jonathan,
>
[quoted text clipped - 5 lines]
>                                     OR
>   Where can I find information regarding equivalent calls in VBA.?

These articles will help

Making the transition from WordBasic to VBA
http://word.mvps.org/FAQs/MacrosVBA/WordBasicToVBA.htm

Useful WordBasic commands that have no VBA equivalent
http://word.mvps.org/FAQs/MacrosVBA/WordBasicCommands.htm

The methods of the WordBasic object are mainly the WordBasic command from
Word 95. The second of the articles contains a link to a location on the
Microsoft website where you can download the Word 95 Wordbasic Help file.

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup


Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.