insertfile command don't work

G

Guest

hello
i have problem with insertfile command,
the following code is
Dim objWord As New Word.Application
objWord.Documents.ADD Application.CurrentProject.Path & "\SC1.dot"
objWord.Visible = True

objWord.Selection.EndKey Unit:=wdStory
objWord.Selection.InsertBreak TYPE:=wdPageBreak
objWord.ChangeFileOpenDirectory "C:\20070117\"
objWord.Selection.InsertFile FileName:="aaaa.doc", Range:="",
ConfirmConversions:=False, Link:=False, Attachment:=False
objWord.Selection.InsertBreak TYPE:=wdPageBreak

With objWord.ActiveDocument.Bookmarks

.Item("comnum").Range.Text = Forms!mainform!COMNUM
.Item("comnum1").Range.Text = Forms!mainform!COMNUM
.Item("comnum2").Range.Text = Forms!mainform!COMNUM
End with

thanks thaks,
 
G

Guest

CAN'T SHOW AAAA.DOC INTO SC1.DOT ,ONLY SHOW BLANK PAGE,
BUT . I OPEN WORD APPLICATION. RUN MARCO, I'S WORK,
WHAT SHOULD I DO.

ACCESS XP
WORD XP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top