I have a macro in normal.dot that I made to open a word doc and format the only table that occupies the whole page to autofit to contents first & then autofit to window, when I do this manually on the document that table gets adjusted properly, but when I try & activate the macro using a program called SAS, by just calling it, the document does not get adjusted. Here is the code form the macro.
Sub Chain_list_format()
'
' temp_list_format Macro
' Macro recorded 4/24/2003 by QUERYMAN
'
ChangeFileOpenDirectory "C:\TEMP
Documents.Open FileName:="TEMP_LIST.doc", ConfirmConversions:=False, _
ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto
Selection.WholeStory
Selection.Tables(1).AutoFitBehavior (wdAutoFitContent)
Selection.Tables(1).AutoFitBehavior (wdAutoFitContent)
Selection.Tables(1).AutoFitBehavior (wdAutoFitWindow)
Selection.Tables(1).AutoFitBehavior (wdAutoFitWindow)
End Sub
Michael
Sub Chain_list_format()
'
' temp_list_format Macro
' Macro recorded 4/24/2003 by QUERYMAN
'
ChangeFileOpenDirectory "C:\TEMP
Documents.Open FileName:="TEMP_LIST.doc", ConfirmConversions:=False, _
ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto
Selection.WholeStory
Selection.Tables(1).AutoFitBehavior (wdAutoFitContent)
Selection.Tables(1).AutoFitBehavior (wdAutoFitContent)
Selection.Tables(1).AutoFitBehavior (wdAutoFitWindow)
Selection.Tables(1).AutoFitBehavior (wdAutoFitWindow)
End Sub
Michael