General information
Category:
Windows API functions
Hi Della, tnx for caring to help me with Word/VBA - it's one of my bad dreams to work with..
I have solved most of my problem by the good old hard work, try and try again,
but a slight problem remains. What I am doing:
A mail merge creates my main document. Then, I want to insert a number of lines immediately following the present text. I now realize that I actually open the document, seems I must have saved if first. Guess that doesn't matter.
This is the relevant code:
# Define wdLine 5
with oWord
.Documents.Open(myDoc)
.Visible = .t.
.Application.Activate
.Selection.MoveDown(wdLine,5)
.selection.TypeText(subs(mystring,1, 90))
endwith
Now, what remains is to perform the same operation, but without making the document window visible.
Remove the .Visible = .t. statement, and I get error: Member SELECTION does not evaluate to an object
Remove the .Activate statement too, and the program works – but the text is inserted at the top instead of at bottom of the document.
The reason I don't leet merge do the whole job is that it seems word2000
messes up mamo fields, by permitting only 256 characters. I therefore break the memo up in a loop which does not show here.
Regards, Rolf
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only