Solved

run in administrator mode vb6

Posted on 2014-11-11
3
156 Views
Last Modified: 2014-11-19
I am trying to extrapolate data from a file using some vb6 code.  I need to be in Administrator mode when opening certain files and running this code in vb6

Private Sub Command1_Click()
Dim objMSWord As Word.Application
Dim myDoc As Word.Document
Set objMSWord = CreateObject("Word.Application")
Set myDoc = objMSWord.Documents.Open("C:\111114.txt")

For Each p In myDoc.Paragraphs
  If InStr(p.Range.Text, "BlockedIP") > 0 Then
   'Skipping - found text
  Else
    p.Range.Delete
  End If
Next

myDoc.SaveAs ("c:\Users\Me\Desktop\052214_2.txt")
myDoc.Close
Set myDoc = Nothing
objMSWord.Quit
End Sub

Open in new window


Is there a way to run this code in administrator mode?
0
Comment
Question by:al4629740
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
brendanmeyer earned 500 total points
ID: 40436676
you wil have to run the exe in administrator mode
0
 

Author Comment

by:al4629740
ID: 40436681
Is there a way for the program to prompt the exe to run in administrator mode?
0
 

Author Closing Comment

by:al4629740
ID: 40454182
Unresolved answer
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question