Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I have done this before but I lost my notes... How do you assign a variable to a Word document when you open it? I thought the following codes would be enough but it gives me the "type mismatch" error. Thanks for you help! Sub xyz() Dim WordApp As Word.Application Dim LetterTemplate As Word.Document Set WordApp = New Word.Application WordApp.Visible = True Set LetterTemplate = WordApp.Documents.Open(Filename:="Blah Blah Blah", ReadOnly:=True) End sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Anson,
Your code works fine for me, as long as I use a fully qualified, proper doc path. -- HTH RP (remove nothere from the email address if mailing direct) "Anson" wrote in message ... Hello, I have done this before but I lost my notes... How do you assign a variable to a Word document when you open it? I thought the following codes would be enough but it gives me the "type mismatch" error. Thanks for you help! Sub xyz() Dim WordApp As Word.Application Dim LetterTemplate As Word.Document Set WordApp = New Word.Application WordApp.Visible = True Set LetterTemplate = WordApp.Documents.Open(Filename:="Blah Blah Blah", ReadOnly:=True) End sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Assign value to a variable name | Excel Discussion (Misc queries) | |||
how do I import variable data into a word document | Excel Discussion (Misc queries) | |||
Assign value to variable | Excel Discussion (Misc queries) | |||
Variable VB to assign new sheet name | Excel Worksheet Functions | |||
assign variable | Excel Programming |