Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Excel VBA Programming: Word Document Compare?


Hi.

I am attempting to get Excel to open two documents in Word, compare, merge and then copy the tracked changed per section into Excel.

I have been having a LOT of trouble finding the command through VBA to complete this. I attmepted to create a Macro in Word and copy it over to Excel but it keeps giving me an error.

Any help is appreciated.

What I have so far:


Sub Draft()


Dim wdApp As Word.Application, wdDoc As Word.Document

On Error Resume Next
Set wdApp = GetObject("Word.Application")
If Err.Number < 0 Then 'Word isn't already running
Set wdApp = CreateObject("Word.Application")
End If
On Error GoTo 0

wdApp.Visible = True

wdApp.ChangeFileOpenDirectory "C:\@Document"
wdApp.ChangeFileOpenDirectory "C:\@Document"
wdApp.MergeDocuments OriginalDocument:=Documents( _
"current rev.doc"), RevisedDocument:= _
Documents("new rev.doc"), Destination:=wdCompareDestinationNew, _
Granularity:=wdGranularityWordLevel, CompareFormatting:=False, _
CompareCaseChanges:=False, CompareWhitespace:=False, CompareTables:=True, _
CompareHeaders:=False, CompareFootnotes:=False, CompareTextboxes:=True, _
CompareFields:=False, CompareComments:=False, CompareMoves:=True, _
OriginalAuthor:="Author", RevisedAuthor:="Author", FormatFrom:= _
wdMergeFormatFromPrompt



Dim EndRun As String
EndRun = "Comparison has been entered into Excel"
MsgBox (EndRun)






Submitted via EggHeadCafe - Software Developer Portal of Choice
WinINetHTTPSend: World's Smallest HTTP Component!
http://www.eggheadcafe.com/tutorials...nd-worlds.aspx
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I convert an Excel document to a Word Document has3801 Setting up and Configuration of Excel 1 June 11th 08 11:16 PM
change excel document into word document mrsb Excel Discussion (Misc queries) 6 August 28th 07 12:58 PM
convert excel document to word document (not a picture) frendabrenda1 Excel Discussion (Misc queries) 2 October 6th 06 03:55 PM
How to change a excel document into a word document? wannaknow Excel Discussion (Misc queries) 1 July 27th 05 09:37 PM
Can you transform an excel document into a word document? Tammy Excel Discussion (Misc queries) 1 May 19th 05 03:23 PM


All times are GMT +1. The time now is 11:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"