Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 12th, 2005, 10:56 PM
Ronny Sigo
Guest
 
Posts: n/a
Default Create a new MS Word object?

Hello all,
In my application I have to open a predefined MS Word document. I do this
with the following code:

Dim sDatum As String
sDatum = Date
Dim sNaamschrijver As String
Dim appWord As Word.Application
Dim wrdDoc As Word.Document
Dim strFileName As String
strFileName = "MyPath\MyFile.doc"
Set appWord = New Word.Application
Set wrdDoc = appWord.Documents.Open(strFileName, ReadOnly = True)
appWord.Visible = True
sNaamschrijver = DLookup("[Volledigenaam]", "tblMwerkers", "[username] = '"
& fOSUser_Name & "'")

Then I merge in the name of the user using the variable sNaamschrijver,
along with some other variables, which all works fine.
Then the user completes the document. After that I CANNOT allow him to save
this document at his own will. It should be saved with a certain naming
convention and at a given path. Therefore I have put a button on the
document which the user has to click. I can put in the button's code the
path where it has to be saved, but not his name. My question is: is there a
way to define a new Word object before the document opens and assigning the
value of sNaamschrijver to it - and how should it be done? After that I
could just put in in the savestring of the word document. Or maybe someone
has a better idea?

Any help very much appreciated ....
Thanks,
Ronny


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles