Results 1 to 2 of 2
  1. #1
    Soule is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Dec 2011
    Posts
    58

    Can't Nail Down UNC Pathname Under Any Circumstances

    Hi, All,
    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?

    Code:
     
    ' 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
    Any input will be appreciated. Thank you.

    Frank

  2. #2
    Soule is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Dec 2011
    Posts
    58
    Had to drop the brackets and add string quotes. Got it.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 0
    Last Post: 02-01-2011, 04:49 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums