PDA

View Full Version : Turn off track changes



Kindly_Kaela
01-31-2007, 02:29 PM
I made a VBA program that edits word documents depending on what the user inputs in the form. I've been working on this for several months. The code opens up a Word Template, makes the changes, and then saves it as a document.

All of a sudden today, TRACK CHANGES is turning on while the document goes through the final editting process. It's also putting that big block of empty space on the far right for comments.

Track Changes is NOT on when I open the template or WORD. Any idea what could be turning this on?

Is it something in this line?


Dim sFolder As String
Dim sUseTemplate As String
sFolder = "\\kora\departments\ProposalGenerator\Templates\ (file://\\kora\departments\ProposalGenerator\Templates\)"
Select Case ProdChoice
Case "ManagedHosting"
sUseTemplate = sFolder & "INVMHS.dot"
Case "ManagedDesktop"
sUseTemplate = sFolder & "INVMITS.dot"
Case "iHosting"
sUseTemplate = sFolder & "iHosting.dot"
Case "iLPAR"
sUseTemplate = sFolder & "iLPAR.dot"
Case "iRemote"
sUseTemplate = sFolder & "iRemote.dot"
Case "Implementation"
sUseTemplate = sFolder & "HostMigration.dot"
Case "Consulting"
sUseTemplate = sFolder & "INV_Consulting.dot"
Case "Development"
sUseTemplate = sFolder & "INV_Development.dot"
Case Else
MsgBox "No Product Specified"
End Select
Documents.Add Template:=sUseTemplate
ActiveDocument.SaveAs FileName:=CompInitials + "_" & _
Format(Now, "mmddyy") + "_Invision", FileFormat:=wdFormatDocument, _
LockComments:=False, Password:="", AddToRecentFiles:=True, _
WritePassword:="", ReadOnlyRecommended:=False, _
EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, _
SaveFormsData:=False, SaveAsAOCELetter:=False

Edit by Lucas: Kaela, please use line breaks as some users in the Word forum do not have large monitors.
Thanks!
Kaela
:cloud9:

fumei
01-31-2007, 02:51 PM
lucas.....thank you thank you thank you


The code opens up a Word Template, makes the changes, and then saves it as a document.
Not strictly correct. You are adding a new document, and attaching the template to it. It does NOT "open a Word template".

OK. Track Changes can not turn itself on. Something is doing that. I can not see anything in the code posted.

I have some questions though.

You state "makes changes". WHERE????Documents.Add Template:=sUseTemplate
ActiveDocument.SaveAsYou add a new document, and immediately save it as.

So where are any changes being made?

WHAT is the document this code is being run from??

Kindly_Kaela
01-31-2007, 02:54 PM
All the changes that are made fall under those lines of code. Traditional stuff like Find/Replace, Delete, Update Table, Importing pricing from SQL, etc.

Kindly_Kaela
01-31-2007, 02:56 PM
The code is run from a WORD document. The Word Doc code then opens a Word Template, saves that template as a Document with a new title (so my template never gets editted) and then all the changes are made to the newly saved/named document.

fumei
01-31-2007, 03:51 PM
Since you chose to repeat yourself, I will repeat myself.
Word Doc code then opens a Word Template, saves that template as a Document with a new title This is simply not correct. I will quote my repetition...
Not strictly correct. You are adding a new document, and attaching the template to it. It does NOT "open a Word template".


You are NOT opening the template file. You are NOT saving that template as a Document with a new name.

Ok, fine, the changes are made to the ActiveDocument.

Hmmm. I still can not see where the Track Changes is coming in. Have you in fact somehow turned on Track Changes in the template file?