Hello.
A guy has Excel 2007 but Word 2003 on his computer. When we automate Word and close and save a document he receives a message asking if it's okay to change his Normal document.
Is is possible to prevent this behaviour when using automation?
Thanks, Andy.
Automate older version of Word
-
- SilverLounger
- Posts: 2403
- Joined: 05 Feb 2010, 22:21
- Location: London ENGLAND
Automate older version of Word
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
-
- Administrator
- Posts: 12632
- Joined: 16 Jan 2010, 15:49
- Location: London, Europe
Re: Automate older version of Word
Are you SURE that he is not changing normal.dot?
Can you test this code with Excel 2003 and Word 2003 to see what it does there.
Can you test this code with Excel 2003 and Word 2003 to see what it does there.
StuartR
-
- SilverLounger
- Posts: 2403
- Joined: 05 Feb 2010, 22:21
- Location: London ENGLAND
Re: Automate older version of Word
Hello. It's my sample code and all it does it write a sentence, save and close:
Andy.
Code: Select all
Dim wd as Word.Application 'with Tools/References Word 11.0 ticked
Set wd = CreateObject("Word.Application")
wd.Visible = True
wd.Documents.Add
wd.Selection.TypeText "Hello to Word"
wd.SaveAs "C:\Some Path\something"
wd.Close
wd.Quit
Set wd = Nothing
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
-
- Administrator
- Posts: 78650
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Automate older version of Word
If the user gets prompted to save Normal.dot with this code, they probably get prompted when they use Word "normally" too.
Best wishes,
Hans
Hans
-
- SilverLounger
- Posts: 2403
- Joined: 05 Feb 2010, 22:21
- Location: London ENGLAND
Re: Automate older version of Word
I thought that as well. I'll check again tomorrow. Maybe they have some company code running when they start Word - that'll probably put the kibosh on automating Word.
Thanks, Andy.
Thanks, Andy.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.