View Single Post
 
Old 07-22-2011, 05:26 PM
Joe Patrick Joe Patrick is offline Windows 7 64bit Office 2007
Advanced Beginner
 
Join Date: May 2011
Posts: 33
Joe Patrick is on a distinguished road
Default How to make Word NOT ConfirmConversion with VBA

Hi,

I'm opening the word doc from Excel. The doc is set to not ask for conversion upon opening but it does anyway when opening with VB code.

Here's my code:

Code:
Sub PopulateWord()
Dim appWD As Word.Application
 
Set appWD = CreateObject("Word.Application")
Sheets("By Event Name").Select
If Range("B2").Value = "" Then
  Range("A1").Select
  Range(Selection, Selection.End(xlToRight)).Select
  Selection.Copy
Else
  Range("A1").Select
  Range(Selection, Selection.End(xlToRight)).Select
  Range(Selection, Selection.End(xlDown)).Select
  Selection.Copy
End If
Application.DisplayAlerts = False
appWD.Documents.Open "U:\TPCentral_Too\Templates\PD_HO_Announcement\PD_HO_Announcement2.htm", ConfirmCoversions = False
appWD.Selection.WholeStory
appWD.Selection.Delete Unit:=wdCharacter, Count:=1
appWD.Selection.Paste
Application.DisplayAlerts = True
appWD.ActiveDocument.Save
appWD.ActiveDocument.Close
appWD.Quit
End Sub
I tried this but get a compile error, named argumetn not found:


Code:
"U:\TPCentral_Too\Templates\PD_HO_Announcement\PD_HO_Announcement2.htm", ConfirmCoversions:=False
Can anyone help me with this, please?

Last edited by Joe Patrick; 07-23-2011 at 05:39 AM. Reason: Added code tags
Reply With Quote