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 / February 2005

Tip: Looking for answers? Try searching our database.

Replacing Wordbasic.Call in Macros

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Phil Stokes - 02 Feb 2005 11:15 GMT
I have various macros that were originally written in Wordbasic. I have
rewritten or converted most to VBA code but one particular piece of code
won't seem to work in VBA so I must be doing something wrong.  an instance is

WordBasic.Call "somemacorname.ITUPrintPSToDisk", filename

will work but If I drop the Wordbasic it will not. (filename is a variable
containing a name of the file to be printed by the macro)

This may be very basic but I can't seem to get it to work.

ps I have got other Call commands to work but not when they refer to a
subroutine in a macro as the one above does.

Thanks

Phil
Martin Seelhofer - 02 Feb 2005 15:40 GMT
Hey Phil

> WordBasic.Call "somemacorname.ITUPrintPSToDisk", filename
>
> will work but If I drop the Wordbasic it will not. (filename is a variable
> containing a name of the file to be printed by the macro)

Here are 2 possible solutions:

1. remove the "-s around your macroname and transform your code
into a normal VBA call:

Call somemacroname.ITUPrintPSToDisk(filename)

2. Use Application.Run instead:

Application.Run "somemacroname.ITUPrintPSToDisk", filename

Cheers,
Martin
Howard Kaikow - 02 Feb 2005 15:45 GMT
somemacorname.ITUPrintPSToDisk  filename

Signature

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

> I have various macros that were originally written in Wordbasic. I have
> rewritten or converted most to VBA code but one particular piece of code
[quoted text clipped - 13 lines]
>
> Phil
Phil Stokes - 03 Feb 2005 12:41 GMT
Tried this
somemacorname.ITUPrintPSToDisk  filename

but it didn't work.

I found that Application.Run worked ok and I'll use that code

Thanks to all that responded.

Phil

> > I have various macros that were originally written in Wordbasic. I have
> > rewritten or converted most to VBA code but one particular piece of code
[quoted text clipped - 14 lines]
> >
> > Phil
Howard Kaikow - 06 Feb 2005 19:40 GMT
Application.run is another alternative.
Depends on how things are set up.

Signature

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

> Tried this
>  somemacorname.ITUPrintPSToDisk  filename
[quoted text clipped - 25 lines]
> > >
> > > Phil

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.