Permission to run VBA script for Outlook

Soldato
Joined
20 Feb 2004
Posts
23,201
Location
Hondon de las Nieves, Spain
I'm currently doing some mail merges and would like to attach a file to the email. Seems this isn't simple by default but i found the website below along with a VBA script to update any emails in the outbox with an attachment after a merge has been done.

Only issue is that when i run the script and select my file i get the following error.

qa74qvA.jpg


The weird issue is that it does actually attach the file to the first email in my outbox but then seems to fall over when moving onto the second. However if i run it a second time it will then add the file to the first and second emails (so the first has 2 copies of the attachment)

I'm using Office 365 which this script doesn't say it supports so i'm going to install an old copy of Outlook 2013 and see if that has any success but does anyone have any ideas what could fix the error?

EDIT to add that i'm the sole user of this computer so shouldn't be an access restrictions issue. I did try to run as administrator but no option to do that.
 
VBA scripts can have viruses so outlook/MS tools normally request permission even if you are logged in as admin.
The word BETA in the script name seems surprising for a tried&tested script too.

Have not done such a mail merge myself - you are trying to import all of the attachments ? - but I would maybe look for another script
 
Yeah i had thought that. Winows does ask for permission to run, which i allow. It's only when it's trying to perform the actual script it fails. I think the issue maybe if Office 365 uses a different to previous version for moving between emails that is where it fails.

I'm emailing everyone in our company and have a pdf attachment i'd like to include. If i have to i can add these manually but with about 1500 i'd prefer not to.

The other option is to just use BCC but i'd prefer to make the email personalised hence the mail merge.
 
They can suck it!

Seriously though the attachment is only 50kb so the whole lot should only amount to about 100mb which should be manageable :)
 
You need to open up the VBS file in something like Notepad and go to line 192 (where the error is occuring) to see what it's actually trying to do that it doesn't have permisisons for.
 
Got massively sidetracked with this. here is the text along with the line number. I don't know whether the text at the beginning counts as a line item though.

189 ' Add the attachment to each email
190 For Each Item In box.Items
191 For Each objFile in ObjWord.FileDialog(1).SelectedItems
192 Item.Attachments.Add(objFile)
193 Next
194 Item.Save


If it also helps i've uploaded the text here
http://textuploader.com/ddvkn
 
Last edited:
Just for info if anyone else looks for this. Whilst i didn't get the VBA script to work.

I did find an MS Word add-on designed by a guy called Doug Robbins. This is brilliant and allows you to select Merge with Attachment from Word and gives lots of options.Well worth installing for anyone else wanting to do this :)
 
Back
Top Bottom