Modifying part of pc-macro to mac?

K

koester.daniel

Hi everyone!
(I hope that this is the right group for this, please let me know if
you know of any group who specialises in macros for mac)

I need some help with a relatively easy macro for word for mac. I have
a macro that I have written for pc but I cant find any relevant help in
the macro enviroment in the mac version so I dont know how to convert
it. The part of the macro that I need help with is the following. I
need to be able to open a folder and select some of the files and the
add there filenames to an array. Its realy simple on the pc, this is
what I have there:

Dim dlgopen As FileDialog
Set dlgopen = Application.FileDialog( _
FileDialogType:=msoFileDialogOpen)
With dlgopen
.AllowMultiSelect = True
.Filters.Clear
.Filters.Add "RTF files", "*.rtf"
.Show
End With
If dlgopen.SelectedItems.Count = 0 Then

MsgBox "You have not selected any files!"
Exit Sub
End If

i = 0
While dlgopen.SelectedItems.Count > i
ReDim Preserve mylist(i + 1)
mylist(i) = dlgopen.SelectedItems.Item(i + 1)
i = i + 1
Wend

Its the dialog part that I am having problems with. So if there is
anyone out there who can help me, please please please!

Best regards
Daniel
 
J

John McGhie [MVP - Word and Word Macintosh]

Hi Daniel:

Eeeewwww.... I think that one may be too hard... You would have to rewrite
that one for, since the msoFileDialogOpen doesn't exist in Mac Word.

You will need to use wdDialogFileFind or wdDialogFileOpen.

See the Help topic "Built-in dialog box argument lists" (which will appear
only if you are in the Visual Basic Editor).

I don't have time to do this for you now: get back to us if you need further
help.

Cheers


Hi everyone!
(I hope that this is the right group for this, please let me know if
you know of any group who specialises in macros for mac)

I need some help with a relatively easy macro for word for mac. I have
a macro that I have written for pc but I cant find any relevant help in
the macro enviroment in the mac version so I dont know how to convert
it. The part of the macro that I need help with is the following. I
need to be able to open a folder and select some of the files and the
add there filenames to an array. Its realy simple on the pc, this is
what I have there:

Dim dlgopen As FileDialog
Set dlgopen = Application.FileDialog( _
FileDialogType:=msoFileDialogOpen)
With dlgopen
.AllowMultiSelect = True
.Filters.Clear
.Filters.Add "RTF files", "*.rtf"
.Show
End With
If dlgopen.SelectedItems.Count = 0 Then

MsgBox "You have not selected any files!"
Exit Sub
End If

i = 0
While dlgopen.SelectedItems.Count > i
ReDim Preserve mylist(i + 1)
mylist(i) = dlgopen.SelectedItems.Item(i + 1)
i = i + 1
Wend

Its the dialog part that I am having problems with. So if there is
anyone out there who can help me, please please please!

Best regards
Daniel

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410
 

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