MS Word Macro

M

mmikedm1000

I am trying to create a Macro in MS Word that will open up a window that is
located:

Insert
Object
Create From File
Browse

The keyboard shortcuts are ctl 'I', 'O', ctl 'F', ctl 'B'

The 'record macro' does not work; it needs to be coded with VB. I am not
sure how to do this. How do I code the macro to open the window. Any help
would be appreciated.
 
D

Doug Robbins - Word MVP

SendKeys "%f%b"
Dialogs(wdDialogInsertObject).Show


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
T

Tony Jollans

I don't think you can do it directly, but you can give the impression of
doing it ...

With Application.FileDialog(msoFileDialogFilePicker)
.AllowMultiSelect = False
If .Show = 0 Then Exit Sub
PickedFile = .SelectedItems(1)
End With
With Dialogs(wdDialogInsertObject)
.Tab = 1
.FileName = PickedFile
.Show
End With

This will not work prior to XP. It can be done a different way but it's a
bit more long winded.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top