M
matthew.rodwell
I couldn't get this to work still....i;m not sure if i am doing it
correctly.
Dim doc1 in the 1st one and the doc1 = Activedocument added intot he
script then the same in 2.....but i still don't know the code to
switch back from the second document which is loaded last back to the
main.,
not copied it all cos its huge
Private Sub cmdOK_Click()
'If the OK button is clicked
doc2 = Documents.Add("C:\OFFICE\WORD\TEMPLATES\bill3.dot")
With ActiveDocument
Selection.WholeStory
Selection.PasteAndFormat (wdPasteDefault)
Selection.HomeKey Unit:=wdStory
'Goes into the header
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
'Inserts the AutoText
Selection.TypeText Text:="NotVAT"
Selection.Range.InsertAutoText
'Goes back into the body of the document
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End With
Unload frmBill
End Sub
correctly.
Dim doc1 in the 1st one and the doc1 = Activedocument added intot he
script then the same in 2.....but i still don't know the code to
switch back from the second document which is loaded last back to the
main.,
not copied it all cos its huge
Private Sub cmdOK_Click()
'If the OK button is clicked
doc2 = Documents.Add("C:\OFFICE\WORD\TEMPLATES\bill3.dot")
With ActiveDocument
Selection.WholeStory
Selection.PasteAndFormat (wdPasteDefault)
Selection.HomeKey Unit:=wdStory
'Goes into the header
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
'Inserts the AutoText
Selection.TypeText Text:="NotVAT"
Selection.Range.InsertAutoText
'Goes back into the body of the document
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End With
Unload frmBill
End Sub