Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP5 word automation
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
VFP5 word automation
Miscellaneous
Thread ID:
00317221
Message ID:
00317221
Views:
68
Hi All,

I'd like to reset the top and bottom margin of the new .doc to 0.5.

This code does not crash but, it also does not change the margins. I've tried moving the code but this doesn't help.

When the .doc loads in "Word", the text is still "selected", do you think this has something to do wioth the margins not be reset?

Any help woould be appreciated, as always.

Thanks,

Jim Harvey
jharvey@netrax.net


***Here's the code
store ThisForm.Sttxtcons.value to mcon
repo form strpconsignorstatement for stncwork.cons_no = ThisForm.Sttxtcons.value ;
to file &mcon ascii
OWORD = createobject("Word.application")
OWORD.visible = .T.
mcurdir = curdir()
myDocument = mcurdir + "\" + "&MCON" + ".DOC"
oword.documents.open(mydocument)
OWORD.activedocument.pagesetup.TopMargin = 0.5
OWORD.activedocument.pagesetup.BottomMargin = 0.5
OWORD.Selection.WholeStory
OWORD.selection.Font.Name = "Courier New"
OWORD.selection.Font.Size = 10
ThisForm.Sttxtcons.value = " "
ThisForm.Sttxtcons.SETFOCUS()
thisform.refresh
Next
Reply
Map
View

Click here to load this message in the networking platform