/    Sign up×
Community /Pin to ProfileBookmark

Execute ActiveXObject("Word.Application") without changing security of web browser

Hello,

I have a piece of JavaScript code which need to use create an ActiveXObject of Word.Application. To run this piece of JavaScript code, I have to un-disable the web browser’s (IE) “Initialize and Script activex controls not marked as safe” setting. Is there a way to avoid changing web browser’s security setting to run the following code?

var msw = new ActiveXObject(“Word.Application”);
var md = msw.Documents.Add(strMyFirstFile);
msw.Visible = True;
wd.Compare(strMySecondFile);//opens one doc w/ MS Word 97, but two docs with MS 2000/2003

I am using this piece of code to compare two MS Word Documents. Beside changing web browser’s security setting, another interesting thing is: If I run this code with MS Word 97, the wd.Compare(strMySecondFile) will open one MS Word document (the compare doc), but if I run the same code with MS Word 2000 or 2003, it will open two MS Word documents (the compare doc, plus separate window opening strMyFirstFile). How can we make the wd.Compare(strMySecondFile) ALWAYS open the compare doc?

Thanks for your help!

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@A1ien51Aug 12.2005 — You can not change the security settings for activeX or else you would be getting a lot more spyware.

Eric
×

Success!

Help @mfu spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.3,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...