I recently got smart and decided to go from a drive-specific path to a UNC path in a GetObject statement. Of course, now I have the syntax to contend with which is being digitally belligerent. I think I have two problems...
1) The full server path I have is \\swba.adpr.acme.com\data\business-eod. Wouldn't this be too much info. for a UNC pathname? Isn't it simply \\server\folder\file? Do I have three server labels here before I even GET to my folder name? I tried excluding the last two labels and still get same errors (below).
2) Should I leave brackets in or out? My impression was that in a GetObject statement, brackets were for data outside the db. I've changed it 2+ ways. With brackets, I get the "External Name Not Defined" error. If I leave out the brackets I get the "Expected: expression" error on the first backslash of the double backslash.
I'm going mental with what was SUPPOSED to make automating code easier. Any ideas?
Expand|Select|Wrap|Line Numbers
- ' This next procedure opens Outlook by retrieving e-mail template...
- ' The error lines in this & each forthcoming procedure block simply tell the code where to go in event of error.
- On Error GoTo PROC_ERR
- Dim objOutlookMsg As Object
- objOutlookMsg = GetObject([\\swba.adpr.acme.com\data\business-eod\A1 Form Button Automation Email Templates\A1 Outlook Template.oft])
- Debug.Print ("Open Outlook by getting template object")
- PROC_EXIT:
- Exit Sub
- PROC_ERR:
- MsgBox "Error opening Outlook by getting template object." & vbCrLf & Err.Number & Err.Description, vbExclamation + vbOKOnly, "Get Outlook Thru Template"
- Resume PROC_EXIT
Frank