demobank.blogg.se

Insert a graphic in word 2016 for mac
Insert a graphic in word 2016 for mac




insert a graphic in word 2016 for mac
  1. Insert a graphic in word 2016 for mac for mac#
  2. Insert a graphic in word 2016 for mac install#
  3. Insert a graphic in word 2016 for mac code#

S = s & "(choose file of type ¬" & vbNewLine S = s & "set applescript's text item delimiters to "",""" & vbNewLine Select the image you wish to insert, and then click the. S = s & "set thePictureFoldersPath to (path to pictures folder)" & vbNewLine Place your cursor on a blank line in the text, and navigate to Insert. ' set this to some other location as appropriate

Insert a graphic in word 2016 for mac code#

Here's the code I used - you would probably need to wrap everything up in another function call and use conditional compilation or other tests to call the correct routine depending on whether the code is running on Mac or Windows Private Sub CMDAddImage_Click()

Insert a graphic in word 2016 for mac install#

If that does not work, then unfortunately you have to use AppleScriptTask which would require you to work some more on the Script and install the script in the correct folder on every Mac where you need this feature. For this, it appears that you can still use the VBA MacScript command, which means that you can put all the script in your VBA file. You don't know what file type the user will choose so you will need to deal with that.Īn alternative is to invoke Applescript. Own filtering set up so the user will have to click Options to enable All Files. Display either can't work or need different syntax.įurther, the Apple dialog may start with its Name = "(_kMDItemFileName = ""*.jpg"")"īefore the. Attempts to set Finder search criteria via something like. However, this dilaog does not let you specify file types or any kind of filtering, a starting folder etc. Set dlg = Application.Dialogs(wdDialogFileOpen) Or if you prefer, the lengthier Dim dlg As Word.Dialog ' but I do not think they are applicable here) ' (THere are other possible return values Display = -1 for "OK" ("Open" in this case) You should check out the suggestion made by in a comment to your previous question - insert an image Content Control in your document instead, and throw away the VBA.īut if you need to keep using VBA and a UserForm.Īpplication.FileDialog is not available on Mac.Īpplication.GetOpenFileName is not avaialble from Word (it's an Excel thing).Īpplication.Dialogs does not do the same thing as GetOpenFileName so the user experience will be rather different, but at its simplest, you can use it like this: With Application.Dialogs(wdDialogFileOpen) In mac it does not allow to add the file. Set objShapes = ActiveDocument.InlineShapesĬan someone please help me edit the code for mac. 'objSelection.TypeText (vbCrLf & "One Picture will be inserted here.")ĪctiveDocument.Bookmarks("Field04").Select 'Set objSelection = ActiveDocument.Sections Set objFileDialog = Application.FileDialog(MsoFileDialogType.msoFileDialogFilePicker)Īnd the code in submit button was: Dim objWord The code I was using is given below: Dim ImagePath As String The add button should allow the user to insert any size image from the local folder. I had added a field for the image in the userform with a button to add the image and the final submit button.

Insert a graphic in word 2016 for mac for mac#

I had used a code earlier which works perfectly in Windows but it doesnt work for MAC and gives a 5948 error. I would like an option of adding an image file in a Microsoft Word document userform for MAC. I am not a programmer so not sure what to do here.






Insert a graphic in word 2016 for mac