-
From a form in my project I'd like to be able to click a button that would lauch the Envelope & Labels Dialog in Word and past the contents of TextBox3 (The Recipients Name) and TextBox4(The Recipients Address, into the "Delivery Address" portion of the Envelope & Dialog Form n Windows. So far I have had no success. ANy ideas here would be most welcomed.
On a related matter, when the Envelope & Labels Dialog Form is viewed is there a way that I can for it in the center of my midi-form like a midi-child.
Thanks,
Rev. Michael L. BUrns
-
Access to Word:
Put a reference to Microsoft Word 9.0 Object Library into your project.
Then this little snippet will provide access into Word:
Dim Obj
Dim OrigFullFile, As String
Set Obj = Word.ActiveDocument
If Obj.Saved = False Then Obj.Save
OrigFullFile = Obj.FullName
Or use something like:
Set obj = Documents("Report.doc")
You can then manipulate Obj. E.g.
Obj.Tables.Add _
Range:=Selection.Range, NumRows:=2, _
NumColumns:=4
I have never done anything with dialogues, but maybe this can help:
Set dlg = Dialogs(wdDialogFileOpen)
aButton = dlg.Display
fSelected = dlg.Name
If aButton = -1 Then
Documents.Open FileName:=fSelected
End If
For more information about displaying Word dialog boxes, see “Displaying built-in Word dialog boxes” in Help.
Cheers, Chris
-
Chris,
Thanks for the input. You have given me somewhere to start and much food for thought.
Pastor Mike
-
1 Attachment(s)
Sample
I got this samplefile for you to test on...
Its not mine but i used it previously to answer some of my own questions. all credits goes to the original maker
-
PCreyght,
Thanks for the attachment. I'll take a look at it after breakfast. Sure I can leard a great deal from it. have a nice day.
Pastor Mike