|
|
|
date: Tue, 24 May 2005 12:36:06 -0700,
group: microsoft.public.word.word97vba
back
RE: Access doc from web
Unfortunately, that's not the problem. I guess I should've included a code
sample to clarify things. I can open documents locally and use the .Merge
method just fine. I also don't have a problem opening documents over the
web. The problem is the method requires a filename parameter in the form of
a string, and for some reason it doesn't seem to like anything starting with
'http://'. Here's some VBScript to illustrate:
----- Start -----
'Open Word'
Dim objWord
Set objWord = CreateObject("Word.Application")
objWord.Visible = True 'Make Word visible'
'Open RTF files'
Dim doc1, doc2
Set doc1 = objWord.Documents.Open("http://my.site.com/path/one.doc")
Set doc2 = objWord.Documents.Open("http://my.site.com/path/two.doc")
'Create difference'
'1 = current, 2 = new, 0 = selected'
Const wdCompareTarget = 2
'' doc1.Merge "http://my.site.com/path/two.doc", , wdCompareTarget
'' doc1.Compare doc2.FullName, , wdCompareTarget
----- End -----
Both of the last two commented lines throw the same invalid doc name or path
error. I know filename parameter is the problem because I can use the
..Content.InsertAfter method on doc1 and doc2 successfully. Anyone know of
another way to reference the documents???
Alternatively, I could paste the text in if there was a way to difference
text instead of files. But I don't know of any way to do that.
date: Wed, 25 May 2005 13:31:05 -0700
author: daiei27
RE: Access doc from web
Hi,
What you could do is create a local copy of the documents and compare it
locally.
activedocument.Sentences.Count this property would give you the number of
sentences in the document, create a loop to select each sentence and insert
it into a new document, save it locally, do the same thing for the second
document. NOw you can comapre the local copies and delete them once you have
done with comparision.
Or othet wya woudl is assign the path to a variable, pass the variable
instead of the file location. May be it would work.
Hope you find it useful
--
"Who will guard the guards?"
"daiei27" wrote:
> Unfortunately, that's not the problem. I guess I should've included a code
> sample to clarify things. I can open documents locally and use the .Merge
> method just fine. I also don't have a problem opening documents over the
> web. The problem is the method requires a filename parameter in the form of
> a string, and for some reason it doesn't seem to like anything starting with
> 'http://'. Here's some VBScript to illustrate:
>
> ----- Start -----
> 'Open Word'
> Dim objWord
> Set objWord = CreateObject("Word.Application")
> objWord.Visible = True 'Make Word visible'
>
> 'Open RTF files'
> Dim doc1, doc2
> Set doc1 = objWord.Documents.Open("http://my.site.com/path/one.doc")
> Set doc2 = objWord.Documents.Open("http://my.site.com/path/two.doc")
>
> 'Create difference'
> '1 = current, 2 = new, 0 = selected'
> Const wdCompareTarget = 2
> '' doc1.Merge "http://my.site.com/path/two.doc", , wdCompareTarget
> '' doc1.Compare doc2.FullName, , wdCompareTarget
> ----- End -----
>
> Both of the last two commented lines throw the same invalid doc name or path
> error. I know filename parameter is the problem because I can use the
> .Content.InsertAfter method on doc1 and doc2 successfully. Anyone know of
> another way to reference the documents???
>
> Alternatively, I could paste the text in if there was a way to difference
> text instead of files. But I don't know of any way to do that.
date: Wed, 25 May 2005 23:32:02 -0700
author: Anand.V.V.N
|
|