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 / April 2007

Tip: Looking for answers? Try searching our database.

Word 2007: Run-time error 4120 Bad Parameter

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jalanford - 27 Apr 2007 20:42 GMT
I have a macro that temporarily sets user options in the editing options of
the Word Options dialog. For the purposes of other macros being run:

Options.ReplaceSelection = True

This works fine in WD2003. In fact, if you record the action of setting this
option manually in the dialog box, you get the above line. However, when I
try to run this as part of a macro or by itself, I get a Run-time error 4120
Bad Parameter error. Something is obviously not right here. I tried changing
the macro security settings but nothing good came of it. I'm running Office
Pro 2007 on XP and I wonder if that's the problem. There was a similar issue
discussed here awhile back and it seems to me that there were varying results
depending on whether the user was running XP or Vista.

Anybody out there know anything about this "feature" and whether it's being
addressed OR whether there is some security setting somewhere that I am
overlooking?

Thanks for your time,

Jalanford
Perry - 30 Apr 2007 15:18 GMT
No problems here.
Toggling this Word setting in VBA at my system works fine.

Perhaps you can elaborate on what the (surrounding) conditions are when y're
trying to
toggle this setting?

--
Krgrds,
Perry

System:
Vista/Office Ultimate
VS2005/VSTO2005 SE

>I have a macro that temporarily sets user options in the editing options of
> the Word Options dialog. For the purposes of other macros being run:
[quoted text clipped - 24 lines]
>
> Jalanford
jalanford - 30 Apr 2007 16:48 GMT
Hello,

In terms of VBA, if I try to run this line by itself with nothing else going
on, it still kicks the error. The initial setting of Options.ReplaceSelection
doesn't matter. When I include the line as part of a larger macro that sets
other editing options, it produces the error (several other lines in that
particular macro also produce this same error--selective and progressive
commenting out of lines lead to this discovery) The other problematic lines
are:

With Options
.AllowDragAndDrop = True
.AutoWordSelection = False
.PictureEditor = "Microsoft Office Word"
.Overtype = False
.CtrlClickHyperlinkToOpen = True
.AutorKeyboardSwitching = False
.PictureWrapType = wdWrapMergeInline
.DisplayPasteOptions = True
.PromptUpdateStyle = False
.FormatScanning = False
.ShowFormatError = False
.SmartParaSelection = False
.SmartCursoring = False
End With

The following lines work and do not produce an error:

With Options
.INSKeyForPaste = False
.PasteSmartCutPaste = False
.AllowAccentedUppercase = False
.TabIndentKey = False
End With

This macro is being run on a Windows machine with a Pentium 4 2.53 GHz CPU
and 1GB of RAM running Windows XP Professional Version 2002 Service Pack 2.

Thanks,

jalanford

> No problems here.
> Toggling this Word setting in VBA at my system works fine.
[quoted text clipped - 39 lines]
> >
> > Jalanford
Perry - 30 Apr 2007 17:36 GMT
Looks like a policy issue here:

These settings are stored in the Registry.
Do you have access to the registry?

Start | Run
and try invoke regedit.exe

--
Krgrds,
Perry

System:
Vista/Office Ultimate
VS2005/VSTO2005 SE

> Hello,
>
[quoted text clipped - 89 lines]
>> >
>> > Jalanford
jalanford - 30 Apr 2007 20:18 GMT
I am able to open the Registry Editor from Start/Run.

Thank you,

jalanford

> Looks like a policy issue here:
>
[quoted text clipped - 11 lines]
> Vista/Office Ultimate
> VS2005/VSTO2005 SE
Perry - 30 Apr 2007 22:04 GMT
Try to restore default settings using the information supplied in below
article.
http://support.microsoft.com/kb/822005

--
Krgrds,
Perry

System:
Vista/Office Ultimate
VS2005/VSTO2005 SE

>I am able to open the Registry Editor from Start/Run.
>
[quoted text clipped - 17 lines]
>> Vista/Office Ultimate
>> VS2005/VSTO2005 SE

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.