> I am doing a mailmerge programatically from VB.NET to Word2000. Mailmerge
> goes fine but the macro's and autotext are disabled. I think since I am
> opening the template document programatically word is disabling the macro.
> Is there a way to tell word to not do this?
Cindy, Thank you for taking the time to answer this. Have a question or two,
though.
You say that in Word 2003 the Word object model has a AutomationSecurity so
would the code look something like this
Dim WordApp As Object
Dim WordDoc As Object
WordApp = CreateObject("Word.Application")
If Val(WordApp.Version) > 9 Then
WordApp.AutomationSecurity = 0
End If
WordDoc = WordApp.Documents.Open(FileName)
Then do the mail merge?
Thanks so much!!
Scott May
> Hi Scott,
>
[quoted text clipped - 25 lines]
> This reply is posted in the Newsgroup; please post any follow question or
> reply in the newsgroup and not by e-mail :-)
Cindy M -WordMVP- - 15 Sep 2004 10:07 GMT
Hi Scott,
> You say that in Word 2003 the Word object model has a AutomationSecurity so
> would the code look something like this
>
Basically, yes. Except that I'd test >= 10 because service packs sometimes
cause the version to come back as something like 9.1.
> Dim WordApp As Object
> Dim WordDoc As Object
[quoted text clipped - 10 lines]
>
> Thanks so much!!
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)