オフィスで書いた VBA スクリプトの機能を確認できるように、IT 担当者から Office 2010 へのアップグレードを受け取りました。これまでに遭遇した唯一のものは、Outlook 2010 のものであり、以下に示されています。行の両端に 3 つの * を付けましたが、機能していません。誰でもアドバイスできますか?オンラインで解決策が見つかりません(アドレスの....は、ここでのみファイルパスを削除することです)
Sub UpdatedQMISReply()
Location = InputBox("Please enter the UNC (http://) path for the new file", "UNC location")
Location2 = InputBox("Please enter the QMIS path for the new file", "UNC location")
'
' UpdatedQMISReply Macro
' Insert QMIS Document Updated text
'
ActiveInspector.WordEditor.Application.Selection.TypeText Text:="Dear User,"
ActiveInspector.WordEditor.Application.Selection.TypeParagraph
ActiveInspector.WordEditor.Application.Selection.TypeParagraph
ActiveInspector.WordEditor.Application.Selection.TypeText Text:="This email is to confirm that your recent file update request to QMIS has now been completed. I have uploaded all the requested files and have saved a copy into the archive folder "
ActiveInspector.WordEditor.Application.Selection.TypeText Text:="(if an old file existed)."
ActiveInspector.WordEditor.Application.Selection.TypeParagraph
ActiveInspector.WordEditor.Application.Selection.TypeParagraph
ActiveInspector.WordEditor.Application.Selection.TypeText Text:="The location on QMIS for the uploaded document is: "
***ActiveInspector.WordEditor.Application.Selection.Hyperlinks.Add Anchor:=Selection.Range, Address:=Location, SubAddress:="", ScreenTip:="", TextToDisplay:=Location2***
ActiveInspector.WordEditor.Application.Selection.TypeParagraph
ActiveInspector.WordEditor.Application.Selection.TypeParagraph
ActiveInspector.WordEditor.Application.Selection.TypeText Text:="If your update was concerning a Health & Safety Document such as a Risk Assessment, or Safe System of Work, then please note that the naming convention for these documents is changing, also the location of the document may change without prior warning as the QMIS infrastructure is modified."
ActiveInspector.WordEditor.Application.Selection.TypeParagraph
ActiveInspector.WordEditor.Application.Selection.TypeParagraph
ActiveInspector.WordEditor.Application.Selection.TypeText Text:="Should you have any further queries regarding this update then please do not hesitate to contact me"
ActiveInspector.WordEditor.Application.Selection.TypeParagraph
ActiveInspector.WordEditor.Application.Selection.TypeParagraph
ActiveInspector.WordEditor.Application.Selection.TypeText Text:="Regards"
End Sub
Sub DocumentRenewalNeeded()
'
' QMIS.DocumentRenewalNeeded Macro
' Macro created 26/10/2011 by stefan.wright
Dim myOlApp As Outlook.Application
Dim myItem As Outlook.MailItem
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olMailItem)
myItem.Subject = "QMIS Document Review Needed"
***myItem.Attachments.Add "\\.........\sites\..........\.........\DOCUMENT UPDATE TRACKER\.............xls"***
myItem.Display
Selection.TypeText Text:="Dear User,"
Selection.TypeParagraph
Selection.TypeParagraph
Selection.TypeText Text:="This email is to inform you that you have documents that are currently out of date on QMIS Document Library. These documents could either be on the Quality worksheet or the HS worksheet so please ensure you check both. Please could you view the QMIS Document Updater Spreadsheet to view the documents which you are responsible for, This can be done by clicking the small arrow in the box which says 'Responsible Person' and then selecting your name, if you then do the same in the 'Colour Code' box and select '2' or '3' you will find the documents which should have been reviewed. If you should find that you are listed on a document and this is incorrect then please let me know and if possible advise me of who should be responsible for that document."
Selection.TypeParagraph
Selection.TypeParagraph
Selection.TypeText Text:="The spreadsheet of QMIS updates is attached to this email."
Selection.TypeParagraph
Selection.TypeParagraph
Selection.TypeText Text:="Should you have any further queries regarding this update then please do not hesitate to contact me. This email will be sent out monthly to those people who have outstanding updates to be completed."
Selection.TypeParagraph
Selection.TypeParagraph
Selection.TypeText Text:="Regards"
End Sub