WD: WordBasic Error #24 Using LoadSavePictures Macro |
Q109682
When you run the LoadSavePictures macro that shipped with Word 2.0c for Windows using Word for Windows versions 6.x, 7.x, you may receive the following WordBasic Error:
WordBasic error #24, "Bad Parameter."
Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please see the following page on the World Wide Web:
http://www.microsoft.com/partner/referral/For more information about the support options available from Microsoft, please see the following page on the World Wide Web:
http://support.microsoft.com/directory/overview.aspYou can change the LoadSavePictures macro code to correct this problem. To do this, follow these steps:
While loc <> 0
nextloc = InStr(loc + 1, a$, "#")
f$(n) = Mid$(a$, loc + 1, nextloc - loc - 1)
Print f$(n)
loc = nextloc
n = n + 1
Wend
Add error trapping statements before and after this set of commands so
the above lines look like this:
On Error Resume Next
While loc <> 0
nextloc = InStr(loc + 1, a$, "#")
f$(n) = Mid$(a$, loc + 1, nextloc - loc - 1)
Print f$(n)
loc = nextloc
n = n + 1
Wend
On Error Goto ExitRestoreOldPictures
While loc <> 0
nextloc = InStr(loc + 1, a$, "#")
f$(n) = Mid$(a$, loc + 1, nextloc - loc - 1)
loc = nextloc
n = n + 1
Wend
InsertField fn$ 'reinsert it as a field
Add error trapping statements before and after this set of commands so
the above lines look like this:
On Error Resume Next
While loc <> 0
nextloc = InStr(loc + 1, a$, ""#"")
f$(n) = Mid$(a$, loc + 1, nextloc - loc - 1)
loc = nextloc
n = n + 1
Wend
On Error Goto ExitRestorePictures
Microsoft Technical Support created the LoadSavePictures macro to alleviate
a problem that occurs when you insert graphics into a large Word 2.x
document. In Word 2.x, LoadSavePictures allows you to insert a graphic into
a document as a linked field, and then run the LoadSavePictures macro
"Compress" option prior to saving the document to reduce the overall file
size. After reopening the document, you can then run the LoadSavePictures
macro to restore the pictures in the document.
If you use the LoadSavePictures macro in Word for Windows versions 6.x or
7.x to restore previously compressed pictures, you receive a WordBasic
error.
Additional query words: error Mid$ LoadSavePictures PSS.DOC
Keywords : kberrmsg kbmacro kbtool wordnt winword ntword macword word6 word7 word95
Issue type : kbprb
Technology : kbWordSearch kbWordWSearch kbWordMSearch
|
Last Reviewed: December 29, 2000 © 2001 Microsoft Corporation. All rights reserved. Terms of Use. |