Automate older version of Word

User avatar
agibsonsw
SilverLounger
Posts: 2403
Joined: 05 Feb 2010, 22:21
Location: London ENGLAND

Automate older version of Word

Post by agibsonsw »

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.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.

User avatar
StuartR
Administrator
Posts: 12632
Joined: 16 Jan 2010, 15:49
Location: London, Europe

Re: Automate older version of Word

Post by StuartR »

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.
StuartR


User avatar
agibsonsw
SilverLounger
Posts: 2403
Joined: 05 Feb 2010, 22:21
Location: London ENGLAND

Re: Automate older version of Word

Post by agibsonsw »

Hello. It's my sample code and all it does it write a sentence, save and close:

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
Andy.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.

User avatar
HansV
Administrator
Posts: 78650
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Automate older version of Word

Post by HansV »

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

User avatar
agibsonsw
SilverLounger
Posts: 2403
Joined: 05 Feb 2010, 22:21
Location: London ENGLAND

Re: Automate older version of Word

Post by agibsonsw »

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.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.